Skip Menu |
 

This queue is for tickets about the URI CPAN distribution.

Report information
The Basics
Id: 94034
Status: rejected
Priority: 0/
Queue: URI

People
Owner: ether [...] cpan.org
Requestors: bertothunder [...] gmail.com
Cc:
AdminCc:

Bug Information
Severity: Important
Broken in: (no value)
Fixed in: (no value)



Subject: URI::Escape -> uri_escape, uri_unescape does not conform to RFC3986
Date: Thu, 20 Mar 2014 11:28:50 +0000
To: bug-URI [...] rt.cpan.org
From: Alberto Curro <bertothunder [...] gmail.com>
Download (untitled) / with headers
text/plain 768b
Hi, I've started using URI::Escape's uri_escape and uri_unescape methods, and found uri_escape creates a escaped version non-conformant to RFC 3986. Input: http://192.168.1.2:8888/HLS 1/1%_--+0.ts Output: http%3A%2F%2F192.168.1.2%3A8888%2FHLS%201%2F1%25_--%2B0.ts But should be: http://192.168.1.2:8888/HLS%201/1%25_--%2B0.ts This is because the %Unsafe is RFC3986 => qr/[^A-Za-z0-9\-\._~]/ while should be RFC3986 => qr/[^A-Za-z0-9\/\-\.\?\[\]\@\$\&#:!=+*(),;'_~]/ With the new %Unsafe, the output is right: http://192.168.1.2:8080/HLS%201/1%25_--+0.ts I've attached a diff file to this message with the proper change. %Unsafe for RFC2732 should be changed as well, but since it's not being used, I've not changed it. Regards Alberto
Download Escape.diff
text/x-diff 356b

Message body is not shown because sender requested not to inline it.

Download (untitled) / with headers
text/plain 877b
Vid Thu, 20 Mar 2014 kl. 07.29.03, skrev bertothunder@gmail.com: Show quoted text
> Hi, > > I've started using URI::Escape's uri_escape and uri_unescape methods, and > found uri_escape creates a escaped version non-conformant to RFC 3986. > > Input: http://192.168.1.2:8888/HLS 1/1%_--+0.ts > > Output: http%3A%2F%2F192.168.1.2%3A8888%2FHLS%201%2F1%25_--%2B0.ts
You are using URI::Escape incorrectly, the uri_escape() function expects a URI component, not a URI reference. The reserved or unreserved characters are different depending on the URI component. RFC 3986 2.3. Unreserved Characters Characters that are allowed in a URI but do not have a reserved purpose are called unreserved. These include uppercase and lowercase letters, decimal digits, hyphen, period, underscore, and tilde. unreserved = ALPHA / DIGIT / "-" / "." / "_" / "~" -- chansen
Download (untitled) / with headers
text/plain 307b
On 2014-10-18 06:37:45, CHANSEN wrote: Show quoted text
> You are using URI::Escape incorrectly, the uri_escape() function > expects a URI component, not a URI reference. The reserved or > unreserved characters are different depending on the URI component.
Thanks Christian; I am taking this ticket to close within 7 days.
closing as promised.


This service is sponsored and maintained by Best Practical Solutions and runs on Perl.org infrastructure.

Please report any issues with rt.cpan.org to rt-cpan-admin@bestpractical.com.