Skip to content

Commit 1feb4c0

Browse files
committed
use fieldslib for Cookie as well
for mirage#38
1 parent e2b4dc5 commit 1feb4c0

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

_tags

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,6 +250,6 @@
250250
<lib_test/test_net_async_server.{native,byte}>: custom
251251
# OASIS_STOP
252252
<lib_test/{test_parser,test_net_lwt,test_net_lwt_server,test_net_mirage_server,test_net_lwt_client_and_server}.ml>: syntax_camlp4o, pkg_lwt.syntax
253-
<cohttp/request.*> or <cohttp/response.*>: syntax_camlp4o, pkg_fieldslib.syntax
253+
<cohttp/request.*> or <cohttp/response.*> or <cohttp/cookie.*>: syntax_camlp4o, pkg_fieldslib.syntax
254254
<lwt/*>: syntax_camlp4o, pkg_lwt.syntax
255255
true: annot, bin_annot, debug, strict_sequence, principal

cohttp/cookie.ml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module Set_cookie_hdr = struct
2828
expiration : expiration;
2929
domain : string option;
3030
path : string option;
31-
secure : bool }
31+
secure : bool } with fields
3232

3333
(* Does not check the contents of name or value for ';', ',', '\s', or name[0]='$' *)
3434
let make ?(expiration=`Session) ?path ?domain ?(secure=false) cookie =
@@ -116,11 +116,6 @@ module Set_cookie_hdr = struct
116116
| _ -> (fun _ a -> a)
117117
) hdr []
118118

119-
let cookie { cookie } = cookie
120-
let expiration { expiration } = expiration
121-
let domain { domain } = domain
122-
let path { path } = path
123-
let secure { secure } = secure
124119
let value { cookie=(_,v) } = v
125120
end
126121

cohttp/cookie.mli

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ module Set_cookie_hdr : sig
2828
expiration : expiration;
2929
domain : string option;
3030
path : string option;
31-
secure : bool }
31+
secure : bool } with fields
3232
(** A header which a server sends to a client to request that the client
3333
returns the cookie in future requests, under certain conditions. *)
3434

0 commit comments

Comments
 (0)