You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Mar 13, 2018. It is now read-only.
Headers passed into the core-ajax element are being set as the prototype properties with Object.create(...).
get requestHeaders() {
var headers = Object.create(this.headers || {});
if (!('content-type' in headers)) {
headers['content-type'] = this.contentType;
}
return headers;
},
Then in core-request, those headers aren't surfacing as part of the xhr.setRequestHeader...
It seems like a good fix would be getPrototypeOf before inspecting and setting the content-type key. I've tested this and the result is a fully populated headers object that core-request handles properly.
get requestHeaders() {
var headers = Object.create(this.headers || {});
headers = Object.getPrototypeOf(headers);
if (!('content-type' in headers)) {
headers['content-type'] = this.contentType;
}
return headers;
},
Headers passed into the core-ajax element are being set as the prototype properties with Object.create(...).
Then in core-request, those headers aren't surfacing as part of the xhr.setRequestHeader...
It seems like a good fix would be getPrototypeOf before inspecting and setting the content-type key. I've tested this and the result is a fully populated headers object that core-request handles properly.