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"





