add test demonstrating #595 in firefox#596
Merged
darrachequesne merged 5 commits intosocketio:masterfrom Mar 9, 2018
Merged
Conversation
Member
|
Thanks, I could indeed reproduce the issue. I think this is linked to #592 (and socketio/engine.io-parser#81, eventually). Due to a bug in the XHR implementation of the Firefox Worker, the line here throws: if (xhr.readyState === 2) {
try {
var contentType = xhr.getResponseHeader('Content-Type');
if (contentType !== 'application/octet-stream') {
xhr.responseType = 'text';
}
} catch (e) {}
}So the content is decoded as a buffer, which breaks UTF-8 encoding. |
…il xhr recieved headers state
Contributor
Author
|
I added a test for binary data in a worker, as well as adding a fix. Now instead of eagerly switching the responeType to 'arrayBuffer', delay doing that until checking the response headers. This seems to fix the issue and still works with binary data. |
Member
|
Thanks! |
2 tasks
darrachequesne
pushed a commit
that referenced
this pull request
Mar 9, 2018
Cherry-picked from master
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
this fails for me about half the time in browser: Firefox 58.0.2 (64-bit)
The kind of change this PR does introduce
Test
Current behaviour
Other information (e.g. related issues)
Issue #595