File tree Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Expand file tree Collapse file tree 2 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -36,6 +36,22 @@ module Request = {
3636 external baseUrl : t => string = "" [@@ bs . get ];
3737 /** [baseUrl request] returns the 'baseUrl' property */
3838
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+
3955 external hostname : t => string = "" [@@ bs . get ];
4056 /** [hostname request] Contains the hostname derived from the Host
4157 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' \
6161run_header_test ' Get' ' GET' ' key: value' \
6262 ' /get'
6363
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-
7164# compare test output to reference data
7265
7366REFERENCE_DATA=reference.data
You can’t perform that action at this time.
0 commit comments