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 · Fixed by #6056
Closed

using WebRequest.CustomRequestHeaders results in crash #6055

susares opened this issue Mar 14, 2019 · 2 comments · Fixed by #6056

Comments

@susares
Copy link
Contributor

susares 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
Copy link
Contributor Author

susares 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
Copy link
Contributor

Thanks for the fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants