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)