mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2025-02-17 00:21:20 -05:00
Merge pull request #142 from mewtaylor/issue/forward-accept-language
Explicitly set `Accept-Language` to cookie lang
This commit is contained in:
commit
7e2751be62
1 changed files with 5 additions and 0 deletions
|
@ -1,5 +1,7 @@
|
|||
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);
|
||||
|
|
Loading…
Reference in a new issue