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

Bug#583510: marked as done (libocamlnet-ocaml-dev: Cannot set custom order for POST headers and unusual headers order.)



Your message dated Thu, 27 May 2010 22:29:00 -0500
with message-id <201005272229.00628.romain.beauxis@gmail.com>
and subject line Re: Bug#583510: libocamlnet-ocaml-dev: Cannot set custom order for POST headers and unusual headers order.
has caused the Debian Bug report #583510,
regarding libocamlnet-ocaml-dev: Cannot set custom order for POST headers and unusual headers order.
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
583510: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=583510
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems
--- Begin Message ---
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



--- End Message ---
--- Begin Message ---
Hmmm.. My issue was unrelated to the order of the header, sorry for the noise.


Romain

Le jeudi 27 mai 2010 17:26:31, Romain Beauxis a écrit :
> 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


--- End Message ---

Reply to: