summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStan Hu <stanhu@gmail.com>2019-08-15 23:20:01 +0000
committerStan Hu <stanhu@gmail.com>2019-08-15 23:20:01 +0000
commitbd5c259a0bb94cb601a3c0f017c383731ac868e6 (patch)
tree51a0594dfa50e8141aa06e3867c72c2836e9494e
parentde9e5068fda66f653346525799b72be536df3e12 (diff)
parentdd9e88eddb24412cfaa82a22c92a9050d44773d0 (diff)
downloadgitlab-ce-bd5c259a0bb94cb601a3c0f017c383731ac868e6.tar.gz
Merge branch 'add-nonce-to-shortcuts-eval' into 'master'
Add nonce to globalEval in shortcuts.js See merge request gitlab-org/gitlab-ce!31837
-rw-r--r--app/assets/javascripts/behaviors/shortcuts/shortcuts.js4
1 files changed, 2 insertions, 2 deletions
diff --git a/app/assets/javascripts/behaviors/shortcuts/shortcuts.js b/app/assets/javascripts/behaviors/shortcuts/shortcuts.js
index eade1283513..7e3515b1f4b 100644
--- a/app/assets/javascripts/behaviors/shortcuts/shortcuts.js
+++ b/app/assets/javascripts/behaviors/shortcuts/shortcuts.js
@@ -4,7 +4,7 @@ import Mousetrap from 'mousetrap';
import axios from '../../lib/utils/axios_utils';
import { refreshCurrentPage, visitUrl } from '../../lib/utils/url_utility';
import findAndFollowLink from '../../lib/utils/navigation_utility';
-import { parseBoolean } from '~/lib/utils/common_utils';
+import { parseBoolean, getCspNonceValue } from '~/lib/utils/common_utils';
const defaultStopCallback = Mousetrap.stopCallback;
Mousetrap.stopCallback = (e, element, combo) => {
@@ -94,7 +94,7 @@ export default class Shortcuts {
responseType: 'text',
})
.then(({ data }) => {
- $.globalEval(data);
+ $.globalEval(data, { nonce: getCspNonceValue() });
if (location && location.length > 0) {
const results = [];