- if (!strcmp(hreq->method, "GET") ||
- !strcmp(hreq->method, "POST") )
+ const char *content_type = z_HTTP_header_lookup(hreq->headers,
+ "Content-Type");
+ /*
+ SRU GET: allow any content type.
+ SRU POST: we support "application/x-www-form-urlencoded";
+ not "multipart/form-data" .
+ */
+ if (!strcmp(hreq->method, "GET")
+ ||
+ (!strcmp(hreq->method, "POST")
+ && content_type &&
+ !yaz_strcmp_del("application/x-www-form-urlencoded",
+ content_type, "; ")
+ )
+ )