Remove CORS avoidance: CORS is now okay
This commit is contained in:
parent
8843f61e06
commit
099762e704
1 changed files with 2 additions and 3 deletions
5
ajax.js
5
ajax.js
|
@ -80,9 +80,8 @@ function getJson(url, options={}) {
|
||||||
|
|
||||||
function postJson(url, data=undefined, options={}) {
|
function postJson(url, data=undefined, options={}) {
|
||||||
if (!options.headers) options.headers = {};
|
if (!options.headers) options.headers = {};
|
||||||
// This triggers CORS, which is not acceptable
|
options.headers["Content-Type"] = MIME_JSON;
|
||||||
//options.headers["Content-Type"] = MIME_JSON;
|
options.headers["Accept"] = MIME_JSON;
|
||||||
//options.headers["Accept"] = MIME_JSON;
|
|
||||||
|
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
let xhr = xhrInitForPromise(resolve, reject, url, "POST", options.headers);
|
let xhr = xhrInitForPromise(resolve, reject, url, "POST", options.headers);
|
||||||
|
|
Loading…
Reference in a new issue