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

The space lost after the colon in getAllResponseHeaders() #68

Open
ewfian opened this issue Oct 1, 2020 · 2 comments
Open

The space lost after the colon in getAllResponseHeaders() #68

ewfian opened this issue Oct 1, 2020 · 2 comments

Comments

@ewfian
Copy link

ewfian commented Oct 1, 2020

I found that The return value of polyfilled getAllResponseHeaders() will not same as native, it will make some thing broken.
I have created a pull request to fix this : #67

  1. The origin http header
    image

  2. Parsed response header
    image

  3. The return value of polyfilled getAllResponseHeaders()
    The space lost here
    image

  4. The FIRST CHAR LOST.
    Some 3rd libraries like azure-sdk-for-js makes http request by using XMLHttpRequest and parses header by itself just like following code
    https://github.com/Azure/azure-sdk-for-js/blob/744e51acb755db2c565c71a8856d8d13e6ec345b/sdk/core/core-https/src/xhrHttpsClient.ts#L129
    If the return value from the polyfilled function XMLHttpRequest.getAllResponseHeaders() is not keeps the exact same format (Date: Thu, 01 Oct 2020 05:18:27 GMT\r\n) as the original value, some thing will broken.
    image

image

@manish2788
Copy link
Member

@ewfian We will have look into the issue. We don't accept pull requests for this repository, we will analyse the issue and publish the fix if required. We keep updated on same.

@ewfian
Copy link
Author

ewfian commented Oct 5, 2020

Thanks for response.
Here is the spec of getAllResponseHeaders() : https://xhr.spec.whatwg.org/#the-getallresponseheaders()-method
(From Azure/azure-sdk-for-js#11581 (comment))

You can find that followed by header’s value, followed by a 0x0D 0x0A byte pair also need to 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

No branches or pull requests

2 participants