Fixed check for application/x-www-form-urlencoded parameters.
authorAdam Dickmeiss <adam@indexdata.dk>
Wed, 15 Oct 2008 09:45:15 +0000 (11:45 +0200)
committerAdam Dickmeiss <adam@indexdata.dk>
Wed, 15 Oct 2008 09:45:15 +0000 (11:45 +0200)
Fixed check for application/x-www-form-urlencoded parameters. When
the content type had a charset specified ;charset=.. for the content type
the match for POST parameters failed. The charset spec is is ignored in
the comparison. Better be UTF-8! Pazpar2 also now logs the POST content.

src/http.c

index ec72838..2ad82ce 100644 (file)
@@ -589,7 +589,8 @@ struct http_request *http_parse_request(struct http_channel *c,
         r->content_len = start + len - buf;
         r->content_buf = buf;
 
-        if (!strcmp(content_type, "application/x-www-form-urlencoded"))
+        if (!yaz_strcmp_del("application/x-www-form-urlencoded",
+                            content_type, "; "))
         {
             http_parse_arguments(r, c->nmem, r->content_buf);
         }
@@ -888,6 +889,8 @@ static void http_io(IOCHAN i, int event)
                         hc->request->path,
                         *hc->request->search ? "?" : "",
                         hc->request->search);
+                if (hc->request->content_buf)
+                    yaz_log(YLOG_LOG, "%s", hc->request->content_buf);
                 if (http_weshouldproxy(hc->request))
                     http_proxy(hc->request);
                 else