-
Notifications
You must be signed in to change notification settings - Fork 76
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
http: handle bad url-encoded Cookie session token #1269
base: master
Are you sure you want to change the base?
Conversation
I'm noticing in the test that Looking at the commit history for this file, it looks like previously, the code retrieved the token from |
@@ -272,6 +272,30 @@ describe('preprocessors', () => { | |||
context.auth.session.should.eql(Option.of(new Session({ test: 'session' }))); | |||
})); | |||
|
|||
it('should reject cookie which cannot be url-decoded', () => { | |||
let caught = false; | |||
Promise.resolve(authHandler( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this promise needs to be returned in order for Mocha to wait on it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very possible. Do tests on line 188 and 208 need the same change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah good catch, that sounds right to me. If there's an assertion in a promise chain, that assertion will only affect the success/failure of the test if the promise is returned to Mocha.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Existing tests fixed at #1286
That would be great 👍 In which case, this PR would be superseded by #1290 |
Related: