-
Notifications
You must be signed in to change notification settings - Fork 49
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ApiRequester.simpleRequest() sets unsafe headers causing Chrome to report "Refused to set unsafe header" #61
Comments
As Tristan mentioned you can work around this for the moment by wrapping the client and have the wrapper remove the two headers before sending the request. |
Didn't mean to close the issue. |
I am trying to work around this issue. I have a
The |
@Sgoettschkes The issue might be that the entry is still in the map, since setting the value to void main() {
print({'key' : 'value'});
print({'key' : 'value'}..['key'] = null);
print({'key' : 'value'}..remove('key'));
} will print
|
@mkustermann And you save me again :) Using |
The workaround is is basically described above: Wrap the underyling browser-based http client and remove the 2 headers before sending it further. For background knowledge: The generated api client libraries try to supply as much information to the underlying @jakobr-google I think the easiest solution would be to allow the generated client libs to accept a boolean whether to set these headers, or have a wrapping-http-client for people to use. Would you be interested in looking into this? |
I'm using Rpc package and it uses http.BrowserClient to send API requests to the server.
However on each POST request, Chrome reports two errors saying:
These two headers are not allowed to be set in a browser as per http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader-method.
It would be great if Rpc requests from the client skipped setting the headers that are not allowed by the browsers.
The text was updated successfully, but these errors were encountered: