Commits

Anonymous committed 8f61569

caml_string_notequal -> String.length (it inlines)

Comments (0)

Files changed (1)

src/amall_http.ml

       read_component ~limit:max_header_len ~name:"header"
         ~break_pred:is_line_term >>= fun header_line ->
       read_line_terminators >>= fun t ->
-      match (t, header_line) with
-      [ (True, "") -> I.return & List.rev acc
-      | (True, _) ->
+      if t
+      then
+        if String.length header_line = 0
+        then
+          I.return & List.rev acc
+        else
           (* process the header *)
           let (first_spaces, header_line, _last_spaces) =
             String.trim_count is_whitespace header_line in
             ]
           else
             read_headers [header_line :: acc]
-      | (False, _) -> fail "premature end of headers"
-      ]
+      else
+        fail "premature end of headers"
     in
       read_headers []
   in