Skip to content

nameless cookie causing hapi fail parsing #2957

@davidhouweling

Description

@davidhouweling

I know that cookies should always have a name, but i stumbled across an issue where something injected a nameless cookie into my code (probably a third party library). But as a result, it causes the request.state to equal null.

To test this, host a site using hapi, in Firefox console...

document.cookie='=1'

Then reload the page (i also set my hapi server.route's config.state.failAction to 'log'), and you get the following in the console/terminal

Internal request error { header: '1', errors: null }

Needs to be a way to tell hapi to drop any invalid cookies like these.

I'm presently using hapi version 9.0.3, so i understand it is a little out of date.

Let me know if this has been fixed in a later version. If so i will look to upgrading.

Metadata

Metadata

Assignees

Labels

non issueIssue is not a problem or requires changes

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions