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

Function GuzzleHttp\Psr7\parse_request($message) doesn't support absolute URI's. #24

Closed
poison opened this issue Jul 7, 2015 · 3 comments

Comments

@poison
Copy link

poison commented Jul 7, 2015

I was wondering why parse_request doesn't support absolute URI's. Request like this fail:

GET https://www.google.com HTTP/1.1

The regex explicity requires a starting slash after the keyword:

if (!preg_match('/^[a-zA-Z]+\s+\/.*/', $data['start-line'])) {
    throw new \InvalidArgumentException('Invalid request string');
}

Are there any objections to support absolute URI's as well? I'm trying to build a php proxy server using reactphp/http (which uses guzzle/psr7) and it doesn't work because of this. If no objections I can create a PR.

Best,
Nicolas

@mtdowling
Copy link
Member

Sounds fine to me.

On Jul 7, 2015, at 3:24 PM, Nicolas notifications@github.com wrote:

I was wondering why parse_request doesn't support absolute URI's. Request like this fail:

GET https://www.google.com HTTP/1.1
The regex explicity requires a starting slash after the keyword:

if (!preg_match('/^[a-zA-Z]+\s+/.*/', $data['start-line'])) {
throw new \InvalidArgumentException('Invalid request string');
}
Are there any objections to support absolute URI's as well? I'm trying to build a php proxy server using reactphp/http (which uses guzzle/psr7) and it doesn't work because of this. If no objections I can create a PR.

Best,
Nicolas


Reply to this email directly or view it on GitHub.

@poison
Copy link
Author

poison commented Jul 15, 2015

Were you able to check my PR #25 ? Any comments on it ?

Best,
Nicolas

@mtdowling
Copy link
Member

PR #25 looks good, but I added a question to it: #25 (comment)

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

2 participants