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
7e2751be
Commit
7e2751be
authored
Oct 23, 2015
by
Andrew Sliwinski
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #142 from mewtaylor/issue/forward-accept-language
Explicitly set `Accept-Language` to cookie lang
parents
9374d917
71435534
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 @
7e2751be
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