iisnode icon indicating copy to clipboard operation
iisnode copied to clipboard

Switch to checking if the conenction header contains 'upgrade' rather than equals 'upgrade'

Open tomfin46 opened this issue 8 years ago • 5 comments

A potential solution to the issue firefox has where it sends both 'keep-alive' and 'upgrade' in the connection header (see https://github.com/tjanczuk/iisnode/issues/497)

I don't have much experience with C++ or the project so if there's any other changes required or tests that need to be updated/created I'm happy to look into that with some direction

tomfin46 avatar Jun 28 '16 09:06 tomfin46

The fix seems to only affect passing through the keep-alive value. I think the underlying problem is that when FireFox sends Connection: keep-alive, Upgrade, IISNode only relays Connection: keep-alive to Node.

NoelAbrahams avatar Jun 28 '16 09:06 NoelAbrahams

I haven't used C++ in quite a while but from what I gathered the reason IISNode is only relaying the keep-alive connection header is because of this line. I believe the check was saying if the connection doesn't exactly equal upgrade then send just keep-alive so if it's changed to the check of just the connection header including upgrade it should pass along both keep-alive and upgrade from firefox.

tomfin46 avatar Jun 30 '16 19:06 tomfin46

There is one problem with this commit: the original checked for upgrade ignoring case (by using stricmp), and with strstr, you lose the ignore case capability, and there is no stristr in the standard library.

Because I didn't want to introduce a stristr function in my patch, I did this instead.

The reason for it not working for Firefox is not that IISNode relays only "keep-alive", the reason is that firefox sends Upgrade with an uppercase U.

ferk6a avatar Jul 04 '16 17:07 ferk6a

Cheers @Fer22f for the comments. Totally didn't twig about the case insensitive stuff.

Updated based on your idea about splitting the header on the comma and checking each one.

Obviously it's not perfect yet and doesn't seem to follow the styling/conventions of the rest of the project but maybe we can build upon this.

tomfin46 avatar Jul 05 '16 11:07 tomfin46

Hey guys. Is this pull request going to be merged?

RayzRazko avatar Sep 28 '17 09:09 RayzRazko