Commit 7e2751be authored by Andrew Sliwinski's avatar Andrew Sliwinski

Merge pull request #142 from mewtaylor/issue/forward-accept-language

Explicitly set `Accept-Language` to cookie lang
parents 9374d917 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);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment