Skip to content

Conversation

@aaronbonneau
Copy link
Contributor

@aaronbonneau aaronbonneau commented Jul 19, 2017

Closes #207

Copy link
Member

@clue clue 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 spotting this issue and filing this PR! 👍

I've successfully reproduced the issue you're seeing and would love to get a fix for this out! :shipit:

However, it looks like the code you've added may cause issues for absolute-form requests (https://tools.ietf.org/html/rfc7230#section-5.3.2), while this should really affect origin-form requests (https://tools.ietf.org/html/rfc7230#section-5.3.1) only. May I ask you to look into this? Thanks!


// make sure value contains valid host component (IP or hostname), but no fragment
if (!isset($parts['scheme'], $parts['host']) || $parts['scheme'] !== 'http' || isset($parts['fragment'])) {
if ((!isset($parts['scheme'], $parts['host']) || $parts['scheme'] !== 'http' || isset($parts['fragment'])) && isset($parts['scheme'])) {
Copy link
Member

Choose a reason for hiding this comment

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

This is now really hard to read and I'm not sure it does what it's supposed to do anymore. It looks like a request-target that starts with :// will now pass this validation?

As an alternative, may I suggest reverting this and updating the above check instead? Your issue can only really happen for origin-target requests, which means we can actually skip this whole block if the request-target starts with a /.

Does this make sense to you?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, this is very difficult to read; I'll update it.

@clue clue added this to the v0.7.3 milestone Jul 27, 2017
Copy link
Member

@clue clue 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 spotting and the quick update! :shipit:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants