Bug#583510: libocamlnet-ocaml-dev: Cannot set custom order for POST headers and unusual headers order.
Package: libocamlnet-ocaml-dev
Version: 2.2.9-8
Severity: wishlist
Hi,
ocamlnet seems to not put the content-length and content-type headers
in last position when sending a HTTP POST request.
Although I do not think this is against the specs, it certainly confuses
some webserver.
For instance, this code:
let call = new Http_client.post_call in
let pipeline = new Http_client.pipeline in
let http_headers = call#request_header `Base in
let body = call#request_body in
call#set_request_uri uri ;
body#set_value request ;
call#set_request_body body ;
http_headers#update_field
"Content-length"
(string_of_int (String.length request));
http_headers#update_field "Content-type" "text/xml";
call#set_request_header http_headers;
pipeline#add call ;
try
pipeline#run () ;
Produces a request of the form:
POST /(...) HTTP/1.1
Content-length: 592
Content-type: text/xml
Date: Thu, 27 May 2010 22:08:53 GMT
User-agent: Netclient
Host: www.host.com
Which is refused by the server:
HTTP/1.1 400 Bad Request
Date: Thu, 27 May 2010 22:08:53 GMT
Server: Apache
Additionaly, one cannot set a custom order for the headers so this cannot
be worked around...
Romain
-- System Information:
Debian Release: squeeze/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.30-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=fr_FR.UTF8, LC_CTYPE=fr_FR.UTF8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash
Versions of packages libocamlnet-ocaml-dev depends on:
ii libcryptgps-ocaml-dev 0.2.1-7+b1 OCaml implementation of symmetric
ii libocamlnet-ocaml [lib 2.2.9-8 OCaml application-level Internet l
ii libpcre-ocaml-dev [lib 6.0.1-3 OCaml bindings for PCRE (Perl Comp
ii ocaml-findlib 1.2.5+debian-1+b1 management tool for OCaml librarie
ii ocaml-nox [ocaml-nox-3 3.11.2-1 ML implementation with a class-bas
Versions of packages libocamlnet-ocaml-dev recommends:
pn libnethttpd-ocaml-dev <none> (no description available)
ii libocamlnet-ocaml-doc 2.2.9-8 OCaml application-level Internet l
libocamlnet-ocaml-dev suggests no packages.
-- no debconf information
Reply to: