Skip to content
This repository has been archived by the owner on Jan 31, 2020. It is now read-only.

Usage of reserved characters in path, unencoded #13

Closed
ghost opened this issue Mar 15, 2017 · 1 comment
Closed

Usage of reserved characters in path, unencoded #13

ghost opened this issue Mar 15, 2017 · 1 comment

Comments

@ghost
Copy link

ghost commented Mar 15, 2017

This issue was originally submitted as zendframework/zendframework#6153.

This is a valid LinkedIn API URL:

https://api.linkedin.com/v1/people/~:(first-name,last-name,email-address)

Using the following code:

$uri = new \Zend\Uri\Http();
$uri->setScheme('https');
$uri->setHost('api.linkedin.com');
$uri->setPath('/v1/people/~:(first-name,last-name,email-address,picture-url)');
echo $uri;

Results in:

https://api.linkedin.com/v1/people/~:%28first-name,last-name,email-address,picture-url%29

The reserved bracket characters are escaped. This resulting URL is not a valid LinkedIn API URL.

Zend\Uri\Uri::toString() uses self::encodePath($this->path) internally, making it impossible to override encodePath()'s behaviour by extending Zend\Uri\Http and replacing the method.

My understanding of the RFC is that reserved characters need not necessarily be escaped where they are being used as delimiters. Should there be some way to represent URLs such as the above?

@samsonasik
Copy link
Contributor

@KGrey I've created PR #17 for it

weierophinney added a commit that referenced this issue Apr 10, 2018
Fixes #13 : reserved characters in path should be unencoded
weierophinney added a commit that referenced this issue Apr 10, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant