File tree Expand file tree Collapse file tree 5 files changed +15
-19
lines changed Expand file tree Collapse file tree 5 files changed +15
-19
lines changed Original file line number Diff line number Diff line change @@ -237,20 +237,17 @@ let parse_content_type = function
237237 match String. split ';' s with
238238 | [] -> None
239239 | a ::l ->
240- let (typ, subtype) =
241- try
242- let typ, subtype = String. sep '/' a in (typ, Some subtype)
243- with Not_found -> a, None
244- in
245- let params =
246- try
247- List. map (String. sep '=' ) l
248- with Not_found -> []
249- in
240+ try
241+ let typ, subtype = String. sep '/' a in
242+ let params =
243+ try
244+ List. map (String. sep '=' ) l
245+ with Not_found -> []
246+ in
250247(* VVV If syntax error, we return no parameter at all *)
251- Some ((typ, subtype), params)
248+ Some ((typ, subtype), params)
252249(* VVV If syntax error in type, we return None *)
253-
250+ with Not_found -> None
254251
255252let get_content_length http_frame =
256253 try
Original file line number Diff line number Diff line change @@ -35,7 +35,7 @@ val find_all : string -> Ocsigen_http_frame.t -> string list
3535val get_keepalive : Ocsigen_http_frame.Http_header .http_header -> bool
3636val parse_cookies : string -> string CookiesTable .t
3737val parse_mime_type : string -> string option * string option
38- val get_host_from_host_header : Ocsigen_http_frame .t ->
38+ val get_host_from_host_header : Ocsigen_http_frame .t ->
3939 string option * int option
4040val get_user_agent : Ocsigen_http_frame .t -> string
4141val get_cookie_string : Ocsigen_http_frame .t -> string option
@@ -44,7 +44,8 @@ val get_if_unmodified_since : Ocsigen_http_frame.t -> float option
4444val get_if_none_match : Ocsigen_http_frame .t -> string list option
4545val get_if_match : Ocsigen_http_frame .t -> string list option
4646val get_content_type : Ocsigen_http_frame .t -> string option
47- val parse_content_type : string option -> ((string * string ) * (string * string ) list ) option
47+ val parse_content_type
48+ : string option -> ((string * string ) * (string * string ) list ) option
4849val get_content_length : Ocsigen_http_frame .t -> int64 option
4950val get_referer : Ocsigen_http_frame .t -> string option
5051val get_referrer : Ocsigen_http_frame .t -> string option
Original file line number Diff line number Diff line change @@ -193,8 +193,7 @@ type file_info = {
193193 filesize : int64 ;
194194 raw_original_filename : string ;
195195 original_basename : string ;
196- file_content_type :
197- ((string * string option ) * (string * string ) list ) option ;
196+ file_content_type : ((string * string ) * (string * string ) list ) option ;
198197 }
199198
200199type request_info =
Original file line number Diff line number Diff line change @@ -140,8 +140,7 @@ type file_info = {
140140 filesize : int64 ;
141141 raw_original_filename : string ;
142142 original_basename : string ;
143- file_content_type :
144- ((string * string option ) * (string * string ) list ) option ;
143+ file_content_type : ((string * string ) * (string * string ) list ) option ;
145144 }
146145
147146(* * The request *)
Original file line number Diff line number Diff line change @@ -112,7 +112,7 @@ let find_field field content_disp =
112112type to_write =
113113 No_File of string * Buffer .t
114114 | A_File of (string * string * string * Unix .file_descr
115- * ((string * string option ) * (string * string ) list ) option )
115+ * ((string * string ) * (string * string ) list ) option )
116116
117117let counter = let c = ref (Random. int 1000000 ) in fun () -> c := ! c + 1 ; ! c
118118
You can’t perform that action at this time.
0 commit comments