Overview
Features
Download
Documentation
Community
Add-Ons & Services

[bug] Poco::URI transforms "%26" to "&" in path

Please post support and help requests here.

[bug] Poco::URI transforms "%26" to "&" in path

Postby koriun » 15 Oct 2012, 16:24

It seems there is bug in Poco::URI when uri string contains "%26" in path.

Here is code for test
Code: Select all
   std::string urlTest = "http://www.example.de/Kultur+%26+Wellness";
   Poco::URI uriTest( urlTest );
   CPPUNIT_ASSERT_EQUAL( urlTest, uriTest.toString() );

and assertion is failed.

In initial URI string "%26" is transformed to "&" (ampersand).

It is important that Poco::URI doesn't do such trasformation, becouse it lost initial information.
Below is code for redirect. Assume web server redirect user to "/Kultur+%26+Wellness" if "/Kultur+&+Wellness" is requested.
then we will have multiple redirects to same link.

Code: Select all
   Poco::URI uri(request.getURI());
   uri.resolve(response.get("Location"));
   request.setURI(uri.toString());


Poco Version 1.4.2

P.S.
This is real case.
URI: "http://www.dialo.de/Stadt/Reutlingen/agil+Kultur+&+Wellness+Konzeptionen-m22771500800"
koriun
 
Posts: 5
Joined: 17 Sep 2010, 15:07

Return to Support

Who is online

Users browsing this forum: No registered users and 3 guests