This repository has been archived by the owner on Jan 26, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Sets unsafe headers #170
Comments
The generator emits code which is used on web and non-web applications, so generally speaking setting the Generated Api classes accept an |
Right. So you suggest overriding |
For future reference, I now use this code which works without issues for my use cases. class ApiBrowserClient extends BrowserClient {
@override
Future<StreamedResponse> send(request) {
request.headers..remove('content-length')..remove('user-agent');
return super.send(request);
}
} |
We are using almost the same code for approximetly one year, and everything works fine for us too. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I use this library to generate client code for my own API that I wrote using
rpc
. The generated code tries to set Content-Length and User-Agent on the requests. However these headers are considered unsafe by the browser. I think it would be appropriate to at least have an option to not set these headers.The text was updated successfully, but these errors were encountered: