You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have a fairly specific bug, but it's reproducible, and I think we have a proposed solution.
First - to recreate the bug: Make a HEAD request to a server running GZIP compression in Node > 5.6. We get an "unexpected end of file" error.
We've traced this down a bit, and it seems to be related to the case sensitivity of the method on line 29 in lib/test.js. Supertest-as-promised forces us to use a lowercase 'head' here.
In SuperAgent, in lib/node/index.js there is are several case sensitive comparisons to "HEAD". This check is missed because of the case issue. On Node LTS, or on Node > 5.x but from a server without GZIP, missing this code path does not throw an exception. On Node > 5.x, when the server does use GZIP, missing this code path causes an exception.
Could we perhaps add a .toUpperCase() on method in lib/test.js?
If that's not possible, I might explore requesting a refactor of supertest-as-promised, but it appears that would be a lot harder.
Any thoughts? I know this is super specific, but it's really problem for us.
The text was updated successfully, but these errors were encountered:
We have a fairly specific bug, but it's reproducible, and I think we have a proposed solution.
First - to recreate the bug: Make a HEAD request to a server running GZIP compression in Node > 5.6. We get an "unexpected end of file" error.
We've traced this down a bit, and it seems to be related to the case sensitivity of the
method
on line 29 in lib/test.js. Supertest-as-promised forces us to use a lowercase 'head' here.In SuperAgent, in lib/node/index.js there is are several case sensitive comparisons to "HEAD". This check is missed because of the case issue. On Node LTS, or on Node > 5.x but from a server without GZIP, missing this code path does not throw an exception. On Node > 5.x, when the server does use GZIP, missing this code path causes an exception.
Could we perhaps add a
.toUpperCase()
onmethod
in lib/test.js?If that's not possible, I might explore requesting a refactor of supertest-as-promised, but it appears that would be a lot harder.
Any thoughts? I know this is super specific, but it's really problem for us.
The text was updated successfully, but these errors were encountered: