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

Invalid header content crashes Cypress #1420

Closed
ScottMaclure opened this issue Mar 6, 2018 · 4 comments
Closed

Invalid header content crashes Cypress #1420

ScottMaclure opened this issue Mar 6, 2018 · 4 comments

Comments

@ScottMaclure
Copy link

ScottMaclure commented Mar 6, 2018

I'll update the below with more information when I can.

  • Operating System: Win10pro
  • Cypress Version: 2.1.0
  • Browser Version: Chrome 64

Is this a Feature or Bug?

Bug

Current behavior:

Testing a site, Cypress crashes with the following express error:

TypeError: The header content contains invalid characters
    at validateHeader (_http_outgoing.js:507:11)
    at ServerResponse.setHeader (_http_outgoing.js:511:3)
    at ServerResponse.header (C:\myapp\node_modules\cypress\dist\Cypress\resources\app\packages\server\node_modules\express\lib\response.js:767:10)
    at ServerResponse.header (C:\myapp\node_modules\cypress\dist\Cypress\resources\app\packages\server\node_modules\express\lib\response.js:770:12)
    at Object.setResHeaders (C:\myapp\node_modules\cypress\dist\Cypress\resources\app\packages\server\lib\controllers\proxy.js:301:18)
    at C:\myapp\node_modules\cypress\dist\Cypress\resources\app\packages\server\lib\controllers\proxy.js:216:17

Desired behavior:

Cypress deals with this gracefully and alerts the dev there was a problem with malformed header content (i.e. "go fix the app" moment).

Check version of express bundled with Cypress and upgrade?

How to reproduce:

TODO - reproduce outside of client site and post here.

Test code:

// was a form submit off a click()

Additional Info (images, stack traces, etc)

@brian-mann
Copy link
Member

Just curl the request outside of Cypress (or just use your site in Chrome) and capture a HAR of the response and send it to us. That would allow us to reproduce this issue.

I'm not sure what the correct behavior should be. Setting invalid header content is not something "you can just force" but it's possible the user agent handles this by stripping it, ignoring it, etc. I'd have to see what chrome does.

@brian-mann brian-mann added the stage: needs information Not enough info to reproduce the issue label Mar 6, 2018
@ScottMaclure
Copy link
Author

ScottMaclure commented Mar 6, 2018

Issue is with a request to 3rd party endpoint, so I'm isolating that first. Will post HAR when I can.

@jennifer-shehane
Copy link
Member

Hi @ScottMaclure, do you have an update on this? Will have to close otherwise.

@ScottMaclure
Copy link
Author

Apologies, no longer active, closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants