File tree 2 files changed +16
-7
lines changed 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,22 @@ module Request = {
36
36
external baseUrl : t => string = "" [@@ bs . get ];
37
37
/** [baseUrl request] returns the 'baseUrl' property */
38
38
39
+ external cookies : t => option (Js . Dict . t Js . Json . t ) = ""
40
+ [@@ bs . get ][@@ bs . return null_undefined_to_opt];
41
+ /** When using cookie-parser middleware, this property is an object
42
+ that contains cookies sent by the request. If the request contains
43
+ no cookies, it defaults to {}.*/
44
+
45
+ external signedCookies : t => option (Js . Dict . t Js . Json . t ) = ""
46
+ [@@ bs . get ][@@ bs . return null_undefined_to_opt];
47
+ /** When using cookie-parser middleware, this property contains signed cookies
48
+ sent by the request, unsigned and ready for use. Signed cookies reside in
49
+ a different object to show developer intent; otherwise, a malicious attack
50
+ could be placed on req.cookie values (which are easy to spoof).
51
+ Note that signing a cookie does not make it “hidden” or encrypted;
52
+ but simply prevents tampering (because the secret used to
53
+ sign is private). **/
54
+
39
55
external hostname : t => string = "" [@@ bs . get ];
40
56
/** [hostname request] Contains the hostname derived from the Host
41
57
HTTP header.*/
Original file line number Diff line number Diff line change @@ -61,13 +61,6 @@ run_header_test 'Accepts Charsets' 'GET' 'Accept-Charset: UTF-8' \
61
61
run_header_test ' Get' ' GET' ' key: value' \
62
62
' /get'
63
63
64
- # run_cookie_test() {
65
- # print_test_title "$1"
66
- # curl -X "$2" --cookie "$3" http://localhost:3000$4 2>&1 >> $TEST_DATA
67
- # }
68
- #
69
- # run_cookie_test 'Cookies' 'GET' 'key=value' '/cookies'
70
-
71
64
# compare test output to reference data
72
65
73
66
REFERENCE_DATA=reference.data
You can’t perform that action at this time.
0 commit comments