Overview
Features
Download
Documentation
Community
Add-Ons & Services

Bug in URL encoding

A general discussion forum.

Bug in URL encoding

Postby vitaliy » 23 Aug 2010, 14:58

Hi All,

I have little C++ app that communicates with Rails app by sending JSON strings. I had intermittent issues where certain types of input would arrive somewhat mangled to the web app. I've traced it down to URL encoding in HTMLForm::writeUrl. As I see this method fails to encode semicolons properly which eventually breaks URL decoding on the web server side. Per RFC & and ; are valid parameter separators.

Changing HTMLForm::writeURL to encode semicolon fixes the problem.
Code: Select all
 ...snip...
      std::string name;
      URI::encode(it->first, "=&+;", name);
      std::string value;
      URI::encode(it->second, "=&+;", value);
 ...snip...


I can also hack web app site and remove semicolon from allowed parameter separators but I think this is a bug on Poco side.

Thanks,
Vitaliy
vitaliy
 
Posts: 5
Joined: 29 Jul 2010, 15:24

Re: Bug in URL encoding

Postby guenter » 23 Aug 2010, 17:20

Thanks. Fixed in the next release (see https://sourceforge.net/tracker/index.p ... tid=725709)
guenter
 
Posts: 1091
Joined: 11 Jul 2006, 16:27
Location: Austria


Return to General Discussion

Who is online

Users browsing this forum: No registered users and 1 guest