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

Handling of server header responses with carriage return \r (IE11) #750

Closed
ansbar opened this issue Jan 25, 2020 · 2 comments
Closed

Handling of server header responses with carriage return \r (IE11) #750

ansbar opened this issue Jan 25, 2020 · 2 comments

Comments

@ansbar
Copy link

ansbar commented Jan 25, 2020

Hi, this is a copy of the closed #422

I hope I can deliver a better explaination later on when speaking to the backend fellows I work with, but the core problem seems to be that some of our pages returns response headers with carriage returns or something (they all look simular but the result differs).

Line 374 in fetch.js

preProcessedHeaders.split(/\r?\n/).forEach(function(line) {

makes the normalizeName throw an error
If I change it to

preProcessedHeaders.split('\r\n').forEach(function(line) {

The result looks the same and works again.

This might be a problem in our application that sends weird headers but you might want to check it out, again? =)

Regards Per

@soda0289
Copy link

soda0289 commented Feb 6, 2020

The problem with IE11 is that it doesnt handle split with regex correctly. I was able to add in a pollyfill for split() to handle the regex correctly.

Split polyfill: https://gist.github.com/slevithan/2048056

@dgraham
Copy link
Contributor

dgraham commented Feb 20, 2020

This is discussed in #748.

@dgraham dgraham closed this as completed Feb 20, 2020
nutgaard added a commit to navikt/modiapersonoversikt that referenced this issue Jun 9, 2020
Gjøres pga følgende issues;
JakeChampion/fetch#750
JakeChampion/fetch#748
zloirock/core-js#751
zloirock/core-js#741

I bunn og grunn, core-js@^3.6.0 introduserte støtte for
String.prototype.split med regex som har sticky-flag. Pga bug her så
fungerer ikke funksjonen som forventet noe mer i eldre IE11 versjoner.

E.g `"test".split(/e/) === ['t', 'e', 's', 't']`, denne burde gitt
`['t', 'st']`
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 1, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants