]> matita.cs.unibo.it Git - helm.git/commitdiff
- catch Not_found exception while regexping headers
authorStefano Zacchiroli <zack@upsilon.cc>
Sun, 5 Jan 2003 14:11:50 +0000 (14:11 +0000)
committerStefano Zacchiroli <zack@upsilon.cc>
Sun, 5 Jan 2003 14:11:50 +0000 (14:11 +0000)
helm/DEVEL/ocaml-http/http_parser.ml

index 1113b701edebb87d89c7d83efcb55f406f64327c..d6a8ddfe077020ab82713e74df9efa60d0a9afad 100644 (file)
@@ -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)