Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/header.ml
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,11 @@ let get_authorization headers =
let is_form headers =
get_media_type headers = (Some "application/x-www-form-urlencoded")

let get_location headers =
match get headers "location" with
| None -> None
| Some u -> Some (Uri.of_string u)

let prepend_user_agent headers user_agent =
let k = "user-agent" in
match get headers k with
Expand Down
1 change: 1 addition & 0 deletions lib/header.mli
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ val add_authorization : t -> Auth.credential -> t
val get_authorization : t -> Auth.credential option
val add_authorization_req : t -> Auth.challenge -> t
val is_form : t -> bool
val get_location : t -> Uri.t option

val user_agent : string
val prepend_user_agent : t -> string -> t
Expand Down