mirror of
https://github.com/scratchfoundation/scratch-www.git
synced 2024-11-23 07:38:07 -05:00
Merge branch 'hotfix/gh-828' into develop
* hotfix/gh-828: Make `X-Requested-With` overridable use `defaults` again Only apply `X-Requested-With` to same domain check street number range for address # Conflicts: # src/lib/api.js
This commit is contained in:
commit
e18e320231
1 changed files with 8 additions and 4 deletions
|
@ -16,15 +16,19 @@ var urlParams = require('./url-params');
|
|||
*/
|
||||
|
||||
module.exports = function (opts, callback) {
|
||||
defaultsDeep(opts, {
|
||||
defaults(opts, {
|
||||
host: process.env.API_HOST,
|
||||
headers: {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
},
|
||||
headers: {},
|
||||
responseType: 'json',
|
||||
useCsrf: false
|
||||
});
|
||||
|
||||
if (opts.host === '') {
|
||||
defaults(opts.headers, {
|
||||
'X-Requested-With': 'XMLHttpRequest'
|
||||
});
|
||||
}
|
||||
|
||||
opts.uri = opts.host + opts.uri;
|
||||
|
||||
if (opts.params) {
|
||||
|
|
Loading…
Reference in a new issue