Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gitlab-ce
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
1
Merge Requests
1
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
gitlab-ce
Commits
a0b3f621
Commit
a0b3f621
authored
Mar 11, 2019
by
Tim Zallmann
Committed by
Mike Greiling
Mar 11, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Removes the CSRF token if the emojis.json is on a CDN
parent
496f9a9e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
1 deletion
+9
-1
app/assets/javascripts/emoji/index.js
app/assets/javascripts/emoji/index.js
+9
-1
No files found.
app/assets/javascripts/emoji/index.js
View file @
a0b3f621
...
@@ -3,6 +3,7 @@ import createFlash from '~/flash';
...
@@ -3,6 +3,7 @@ import createFlash from '~/flash';
import
{
s__
}
from
'
~/locale
'
;
import
{
s__
}
from
'
~/locale
'
;
import
emojiAliases
from
'
emojis/aliases.json
'
;
import
emojiAliases
from
'
emojis/aliases.json
'
;
import
axios
from
'
../lib/utils/axios_utils
'
;
import
axios
from
'
../lib/utils/axios_utils
'
;
import
csrf
from
'
../lib/utils/csrf
'
;
import
AccessorUtilities
from
'
../lib/utils/accessor
'
;
import
AccessorUtilities
from
'
../lib/utils/accessor
'
;
...
@@ -24,7 +25,14 @@ export function initEmojiMap() {
...
@@ -24,7 +25,14 @@ export function initEmojiMap() {
resolve
(
emojiMap
);
resolve
(
emojiMap
);
}
else
{
}
else
{
// We load the JSON from server
// We load the JSON from server
axios
const
axiosInstance
=
axios
.
create
();
// If the static JSON file is on a CDN we don't want to send the default CSRF token
if
(
gon
.
asset_host
)
{
delete
axiosInstance
.
defaults
.
headers
.
common
[
csrf
.
headerKey
];
}
axiosInstance
.
get
(
.
get
(
`
${
gon
.
asset_host
||
''
}${
gon
.
relative_url_root
||
`
${
gon
.
asset_host
||
''
}${
gon
.
relative_url_root
||
''
}
/-/emojis/
${
EMOJI_VERSION
}
/emojis.json`
,
''
}
/-/emojis/
${
EMOJI_VERSION
}
/emojis.json`
,
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment