Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
scratch-www
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
scratch-www
Commits
71435534
Commit
71435534
authored
Oct 22, 2015
by
Matthew Taylor
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Explicitly set `Accept-Language` to cookie lang
So that xhr requests to scratchr2 can get the right language
parent
fe96c6fa
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
0 deletions
+5
-0
src/mixins/api.jsx
src/mixins/api.jsx
+5
-0
No files found.
src/mixins/api.jsx
View file @
71435534
var
defaults
=
require
(
'
lodash.defaults
'
);
var
xhr
=
require
(
'
xhr
'
);
var
jar
=
require
(
'
../lib/jar.js
'
);
var
log
=
require
(
'
../lib/log.js
'
);
var
CookieMixinFactory
=
require
(
'
./cookieMixinFactory.jsx
'
);
...
...
@@ -30,6 +32,9 @@ var Api = {
});
}.
bind
(
this
);
if
(
typeof
jar
.
get
(
'
scratchlanguage
'
)
!==
'
undefined
'
)
{
opts
.
headers
[
'
Accept-Language
'
]
=
jar
.
get
(
'
scratchlanguage
'
)
+
'
, en;q=0.8
'
;
}
if
(
opts
.
useCsrf
)
{
this
.
useScratchcsrftoken
(
function
(
err
,
csrftoken
)
{
if
(
err
)
return
log
.
error
(
'
Error while retrieving CSRF token
'
,
err
);
...
...
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