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

fix: loopback redirectUriAllowed protocol check #794

Merged
merged 1 commit into from
Oct 3, 2020

Conversation

mureinik
Copy link
Contributor

@mureinik mureinik commented Oct 3, 2020

The condition !parsed.protocol === 'http:' always returns false. The ! operator has a higher precedence than the === operator. parsed.protocol is a string, so negating it would be false. Then, it's clear that false === 'http:' is always false.

It seems that the intended check was parsed.protocol !== 'http:'.

The condition `!parsed.protocol === 'http:'` always returns `false`.
The `!` operator has a higher precedence than the `===` operator.
`parsed.protocol` is a string, so negating it would be `false`. Then,
it's clear that `false === 'http:'` is always `false`.

It seems that the intended check was `parsed.protocol !== 'http:'`.
Copy link
Owner

@panva panva left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for catching this, clearly an oversight on my part when this was being refactored

@panva panva changed the title fix(client.js): redirectUriAllowed protocol check fix: loopback redirectUriAllowed protocol check Oct 3, 2020
@panva panva merged commit da99330 into panva:master Oct 3, 2020
@mureinik mureinik deleted the http-redirect branch October 3, 2020 21:11
@github-actions github-actions bot locked and limited conversation to collaborators Jan 2, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants