Skip to content
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

using WebRequest.CustomRequestHeaders results in crash #6055

Closed
susares opened this issue Mar 14, 2019 · 2 comments

Comments

Projects
None yet
2 participants
@susares
Copy link
Contributor

commented Mar 14, 2019

setting WebRequest.CustomRequestHeaders results in a crash for any caller upon WebRequest.open.
This is because the headers must be injected when the request is in state 'open'.

playground link
=> uncommenting WebRequest... line will result in an error

  • Expected result: custom headers should be injected
  • Current result: custom headrs won't be injected but result in a crash
@susares

This comment has been minimized.

Copy link
Contributor Author

commented Mar 14, 2019

There might be also an issue with WebRequest.CustomRequestModifiers.
They are applied before the state is open.
If someone uses a CustomRequestModifier to inject headers it would result in the same crash.

simply moving the 'update' calls to where I moved the _injectCustomHeaders section. might not give expected results due to Modifiers that want to set attributes thats should be used by i.e. 'open'

@deltakosh

This comment has been minimized.

Copy link
Contributor

commented Mar 14, 2019

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.