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>
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

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

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
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.