libmicrohttpd
[Top][All Lists]
Advanced

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

Re: [libmicrohttpd] Retrieving GET parameters in form http://...?wsdl


From: Christian Grothoff
Subject: Re: [libmicrohttpd] Retrieving GET parameters in form http://...?wsdl
Date: Tue, 27 Sep 2011 13:01:26 +0200
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.16) Gecko/20110818 Icedove/3.0.11

Hi!

This is a good question, I didn't think this kind of HTTP request was even legal... But I think we could make it work. First of all, the current code just throws the "wsdl" away, but we can fix that:

$ svn diff
Index: src/daemon/connection.c
===================================================================
--- src/daemon/connection.c     (revision 17024)
+++ src/daemon/connection.c     (working copy)
@@ -1056,7 +1056,17 @@
     {
       equals = strstr (args, "=");
       if (equals == NULL)
-        return MHD_NO;          /* invalid, ignore */
+       {
+         /* add with 'value' NULL */
+ connection->daemon->unescape_callback (connection->daemon->unescape_callback_cls,
+                                                connection,
+                                                args);
+       
+         return connection_add_header (connection,
+                                       args,
+                                       NULL,
+                                       kind);
+       }
       equals[0] = '\0';
       equals++;
       amper = strstr (equals, "&");

With that change, you should then be able to get to the data using 'MHD_get_connection_values'. You would be called with a key of "wsdl" and a value of NULL. If the URL had been "...?wdsl=" the value would be the empty string ("").

This is just how I suggest we should do this, I didn't test this yet.

Happy hacking,

Christian


On 09/27/2011 08:52 AM, CHIARAMELLO Daniel wrote:
Hi all.

Im a confronted to a GET request that I'm not able to recognize...

The request is the following:

http://blabla.blabla.bla/blabla/blabla?wsdl

I first thought that I could recognize such request by doing a:

const char* value = MHD_lookup_connection_value(
         connection,
         MHD_GET_ARGUMENT_KIND,
         "wsdl");

But it's not the case - this only works if the Url was expressed in the form
?wsld=something

Is there a way to recognize it?

Thanks for your attention,
Daniel






reply via email to

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