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

Errors from (fault)net::ERR_EMPTY_RESPONSE and TypeError [ERR_INVALID_HTTP_TOKEN]: Internal error during proxy #28865

Closed
francllinrios opened this issue Feb 5, 2024 · 4 comments · Fixed by #29420

Comments

@francllinrios
Copy link

francllinrios commented Feb 5, 2024

Current behavior

When I run my automation it returns an unknown error. and only in the Cypress browser on Chrome or any other it gives this error, if I log in outside of the browser that Cypress opens it opens the normal application screen.

ERROR:

GET / - - ms - -
Internal error while proxying "GET http://salesportalcli.hml.prodatamobility.com.br/" in OmitProblematicHeaders:
Header name must be a valid HTTP token ["expires "]
TypeError [ERR_INVALID_HTTP_TOKEN]: Internal error while proxying "GET http://salesportalcli.hml.prodatamobility.com.br/" in OmitProblematicHeaders:
Header name must be a valid HTTP token ["expires "]
    at ServerResponse.setHeader (node:_http_outgoing:665:3)
    at PatchExpressSetHeader.res.setHeader (<embedded>:4432:12149)
    at N.set.N.header (<embedded>:2788:8408)
    at N.set.N.header (<embedded>:2788:8448)
    at Object.OmitProblematicHeaders (<embedded>:4432:12684)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.PatchExpressSetHeader (<embedded>:4432:12371)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.b (<embedded>:4414:143640)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.AttachPlainTextStreamFn (<embedded>:4432:11583)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.FilterNonProxiedResponse (<embedded>:4432:10978)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.LogResponse (<embedded>:4432:10577)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at A (<embedded>:4432:37153)
    at <embedded>:4432:40547
    at tryCatcher (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:694:18)
    at _drainQueueStep (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate._onImmediate (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:17:14)
    at process.processImmediate (node:internal/timers:476:21)
image

image

Desired behavior

You should be able to return to the login scenario without showing this error and should open the normal screen as shown in the image.

image

Test code to reproduce

GET / - - ms - -
Internal error while proxying "GET http://salesportalcli.hml.prodatamobility.com.br/" in OmitProblematicHeaders:
Header name must be a valid HTTP token ["expires "]
TypeError [ERR_INVALID_HTTP_TOKEN]: Internal error while proxying "GET http://salesportalcli.hml.prodatamobility.com.br/" in OmitProblematicHeaders:
Header name must be a valid HTTP token ["expires "]
    at ServerResponse.setHeader (node:_http_outgoing:665:3)
    at PatchExpressSetHeader.res.setHeader (<embedded>:4432:12149)
    at N.set.N.header (<embedded>:2788:8408)
    at N.set.N.header (<embedded>:2788:8448)
    at Object.OmitProblematicHeaders (<embedded>:4432:12684)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.PatchExpressSetHeader (<embedded>:4432:12371)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.b (<embedded>:4414:143640)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.AttachPlainTextStreamFn (<embedded>:4432:11583)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.FilterNonProxiedResponse (<embedded>:4432:10978)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.LogResponse (<embedded>:4432:10577)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at A (<embedded>:4432:37153)
    at <embedded>:4432:40547
    at tryCatcher (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:694:18)
    at _drainQueueStep (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate._onImmediate (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:17:14)
    at process.processImmediate (node:internal/timers:476:21)

Cypress Version

13.6.4

Node version

v18.16.0

Operating System

macOS e ubuntu 23.10

Debug Logs

GET / - - ms - -
Internal error while proxying "GET http://salesportalcli.hml.prodatamobility.com.br/" in OmitProblematicHeaders:
Header name must be a valid HTTP token ["expires "]
TypeError [ERR_INVALID_HTTP_TOKEN]: Internal error while proxying "GET http://salesportalcli.hml.prodatamobility.com.br/" in OmitProblematicHeaders:
Header name must be a valid HTTP token ["expires "]
    at ServerResponse.setHeader (node:_http_outgoing:665:3)
    at PatchExpressSetHeader.res.setHeader (<embedded>:4432:12149)
    at N.set.N.header (<embedded>:2788:8408)
    at N.set.N.header (<embedded>:2788:8448)
    at Object.OmitProblematicHeaders (<embedded>:4432:12684)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.PatchExpressSetHeader (<embedded>:4432:12371)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.b (<embedded>:4414:143640)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.AttachPlainTextStreamFn (<embedded>:4432:11583)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.FilterNonProxiedResponse (<embedded>:4432:10978)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at Object.next (<embedded>:4432:36627)
    at Object.LogResponse (<embedded>:4432:10577)
    at <embedded>:4432:36868
    at Promise.cancellationExecute [as _execute] (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/debuggability.js:335:9)
    at Promise._resolveFromExecutor (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:483:18)
    at new Promise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:79:10)
    at d (<embedded>:4432:35785)
    at A (<embedded>:4432:37153)
    at <embedded>:4432:40547
    at tryCatcher (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/util.js:16:23)
    at Promise._settlePromiseFromHandler (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:512:31)
    at Promise._settlePromise (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:569:18)
    at Promise._settlePromise0 (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:614:10)
    at Promise._settlePromises (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/promise.js:694:18)
    at _drainQueueStep (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:138:12)
    at _drainQueue (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:131:9)
    at Async._drainQueues (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:147:5)
    at Immediate._onImmediate (/Users/francllinrios/Library/Caches/Cypress/13.6.4/Cypress.app/Contents/Resources/app/node_modules/bluebird/js/release/async.js:17:14)
    at process.processImmediate (node:internal/timers:476:21)

Other

No response

@jennifer-shehane
Copy link
Member

@francllinrios Cypress has a proxy that pulls all the headers off of the requests and resets them (if needed). This erroring is surfacing that there is an invalid HTTP header since this error is being thrown when we set it from Node's https://www.geeksforgeeks.org/node-js-http-validateheadername-method/

If this is your website: http://salesportalcli.hml.prodatamobility.com.br/, you have an invalid HTTP header that your setting and those requests will silently not go through. You need to remove the extra character in the expires header to fix this. So this is highlighting a bug on that website.

That being said, Cypress should handle this better. Perhaps we should validate that the HTTP headers are correct before resetting them? Or just catch and ignore and errors that are thrown here? Probably second option makes more sense. /~https://github.com/cypress-io/cypress/blob/fix-flake-on-launchpad-ui/packages/proxy/lib/http/response-middleware.ts#L332

@jennifer-shehane jennifer-shehane added type: bug stage: ready for work The issue is reproducible and in scope good first issue Good for newcomers labels Feb 5, 2024
@BernardoSousa03
Copy link
Contributor

@jennifer-shehane Hi! After some time spent reproducing the bug i managed to do it. I can make cypress raise the error with the visit command but the request command still goes through and I'm still trying to understand why. As to the solution, i followed your suggestion and just ignored the error but shouldn't cypress inform that the header is invalid? Maybe give some type of warning in the console? I'm interested in creating a PR to fix this.

@jennifer-shehane
Copy link
Member

@BernardoSousa03 Yah, we should handle this better I think.

BernardoSousa03 added a commit to BernardoSousa03/cypress that referenced this issue Apr 23, 2024
…ypress-io#28865

When receiving the described HTTP response Cypress might reset the headers of the response. This would cause
the validateHeaderName method from node to be called which would cause an error, since the headers where invalid.
Now Crypress verifies all the headers before reseting them, discards invalid ones and sends a warning in the console when debug module is on.
BernardoSousa03 added a commit to BernardoSousa03/cypress that referenced this issue Apr 23, 2024
…o#28865

When receiving the described HTTP response Cypress might reset the headers of the response. This would cause
the validateHeaderName method from node to be called which would cause an error, since the headers were invalid.
Now Crypress verifies all the headers before reseting them, discards invalid ones and sends a warning in the console when debug module is on.
BernardoSousa03 added a commit to BernardoSousa03/cypress that referenced this issue Apr 24, 2024
…o#28865

When receiving the described HTTP response Cypress resets the headers.
This would cause the validateHeaderName method from node to be called
which would cause an error, since the headers were invalid.
Now Crypress verifies all the headers before reseting them,
discards invalid ones and sends a warning in the console
when debug module is on.
BernardoSousa03 added a commit to BernardoSousa03/cypress that referenced this issue Apr 26, 2024
…o#28865

When receiving the described HTTP response Cypress resets the headers.
This would cause the validateHeaderName method from node to be called
which would cause an error, since the headers where invalid.
Now Crypress verifies all the headers before reseting them,
discards invalid ones and sends a warning in the console
when debug module is on.
BernardoSousa03 added a commit to BernardoSousa03/cypress that referenced this issue Apr 26, 2024
…o#28865

When receiving the described HTTP response Cypress resets the headers.
This would cause the validateHeaderName method from node to be called
which would cause an error, since the headers where invalid.
Now Crypress verifies all the headers before reseting them,
discards invalid ones and sends a warning in the console
when debug module is on.
@jennifer-shehane jennifer-shehane removed the good first issue Good for newcomers label May 9, 2024
jennifer-shehane added a commit that referenced this issue Jun 11, 2024
…29420)

* fix: HTTP response with invalid headers doesn't throw error #28865

When receiving the described HTTP response Cypress resets the headers.
This would cause the validateHeaderName method from node to be called
which would cause an error, since the headers where invalid.
Now Crypress verifies all the headers before reseting them,
discards invalid ones and sends a warning in the console
when debug module is on.

* fix: improved warning display to the command line

When cutting off invalid headers from the response the user
is informed of such headers in the command line

* fix: added undefined verification and catched missing error

Fixed a typescript error where validateHeaderValue was being called
with value possibly being undefined. Fixed catching missing error
where code is 'ERROR_INVALID_CHAR' and rethrows other errors

* Update cli/CHANGELOG.md

---------

Co-authored-by: Jennifer Shehane <jennifer@cypress.io>
Co-authored-by: Cacie Prins <cacieprins@users.noreply.github.com>
Co-authored-by: Bill Glesias <bglesias@gmail.com>
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Jun 18, 2024

Released in 13.12.0.

This comment thread has been locked. If you are still experiencing this issue after upgrading to
Cypress v13.12.0, please open a new issue.

@cypress-bot cypress-bot bot removed the stage: ready for work The issue is reproducible and in scope label Jun 18, 2024
@cypress-bot cypress-bot bot locked as resolved and limited conversation to collaborators Jun 18, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants