From 1b40dfaab5c1d0b9c726b7606989b82aca7658d8 Mon Sep 17 00:00:00 2001 From: Stefano Zacchiroli Date: Sun, 5 Jan 2003 14:11:50 +0000 Subject: [PATCH] - catch Not_found exception while regexping headers --- helm/DEVEL/ocaml-http/http_parser.ml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) 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) -- 2.39.2