From: Stefano Zacchiroli Date: Sun, 5 Jan 2003 14:11:50 +0000 (+0000) Subject: - catch Not_found exception while regexping headers X-Git-Tag: v0_3_99~93 X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=commitdiff_plain;h=1b40dfaab5c1d0b9c726b7606989b82aca7658d8;p=helm.git - catch Not_found exception while regexping headers --- diff --git a/helm/DEVEL/ocaml-http/http_parser.ml b/helm/DEVEL/ocaml-http/http_parser.ml index 1113b701e..d6a8ddfe0 100644 --- a/helm/DEVEL/ocaml-http/http_parser.ml +++ b/helm/DEVEL/ocaml-http/http_parser.ml @@ -118,7 +118,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)