libmicrohttpd
[Top][All Lists]
Advanced

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

[libmicrohttpd] Escaped characters in URL


From: david . myers
Subject: [libmicrohttpd] Escaped characters in URL
Date: Tue, 22 Sep 2015 16:47:16 +0000
User-agent: Roundcube Webmail/1.0.2

Hi there,

I've been using libmicrohttpd for a number of years now, but I have just found a basic problem with my URL parser when I receive a URL with escaped characters. In my webpage I am using the _javascript_ function, encodeURIComponent() to help produce the escaped URL, something like this:-

setcamparam.cgi?camname=cam&fred, where "cam&fred" is the name string

This is converted into the following url

setcamparam.cgi?camname=cam%26fred

which is fine.

The problem is in my http_access_callback, when I receive this url, I seem to receive "cam&fred" unescaped, but the length of the field I need to skip in the url is 2 more than the string length. If there are more escaped characters in the url, then the difference is even higher.

How do I know how many escaped characters have been unescaped so that I can parse the url correctly and skip to the next field? I'm just using strlen() to skip over each field.

Best regards

David

 

reply via email to

[Prev in Thread] Current Thread [Next in Thread]