Problem with HTTP queries



Hi
I've been using libsoup recently and I've discovered a problem with
the URL encoding and decoding. Here is a huge write up. Let's say here
is the URL I'm trying to post as it's passed to soup_message_new:

http://example.com/protocol_1.1?
a[0]=Tom%20Waits&
t[0]=Old%20Shoes%20(%26%20Picture%20Postcards)&
b[0]=Closing%20Time

You might see it's part of a last.fm submission. The important part is
that it's going to get rejected, because the %26 in the song title is
an & and it gets decoded again before submission. So the url actually
posted is this:

http://example.com/protocol_1.1?
a[0]=Tom Waits&
t[0]=Old Shoes (& Picture Postcards)&
b[0]=Closing Time

Now I don't know much about http so I don't have a clue about this
whole encoding and then decoding business. What I do know is that if I
fix up soup_uri_decode to ignore the %26 character and leave that
encoded, the submit goes through fine. It's pretty obvious what the
problem is here.

I hope I'm not doing something really stupid here. I pass "&+:-" to
soup_uri_encode as extra characters (I don't know if they're all
necessary heh) but there's no way to prevent soup_uri_decode decoding
them all again and making a crazy url that isn't right. Is soup
supposed to do this? If not, what's the best way to go about fixing
it?
Thanks for any help, soup is really nice to use apart from this one issue heh



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]