X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;f=helm%2FDEVEL%2Focaml-http%2Fhttp_parser.ml;h=52c84570c285fed86f4af115a83f226df65580b4;hb=841f96d4a534645067f92e9701b55edcc21e9600;hp=1113b701edebb87d89c7d83efcb55f406f64327c;hpb=ca9cd0aeee0ce78a891f7f6091ca8704231a446d;p=helm.git diff --git a/helm/DEVEL/ocaml-http/http_parser.ml b/helm/DEVEL/ocaml-http/http_parser.ml index 1113b701e..52c84570c 100644 --- a/helm/DEVEL/ocaml-http/http_parser.ml +++ b/helm/DEVEL/ocaml-http/http_parser.ml @@ -97,6 +97,7 @@ let debug_dump_request path params = let parse_request_fst_line ic = let request_line = generic_input_line ~sep:crlf ~ic in + debug_print (sprintf "HTTP request line (not yet parsed): %s" request_line); match Pcre.split ~rex:pieces_sep request_line with | [ meth_raw; uri_raw; http_version_raw ] -> (try @@ -118,7 +119,11 @@ let parse_headers ic = match generic_input_line ~sep:crlf ~ic with | "" -> List.rev headers | line -> - (let subs = Pcre.extract ~rex:header_RE line in + (let subs = + try + Pcre.extract ~rex:header_RE line + with Not_found -> raise (Invalid_header line) + in let header = try subs.(1)