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

Usage of reserved characters in path, unencoded #13

Closed
@ghost

Description

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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions