Skip to content

Commit bec4662

Browse files
mflattBogdanp
authored andcommitted
fix contract on make-session
Allow `#:cookie-jar #f` as in docs and default.
1 parent f3bafda commit bec4662

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

http-easy-lib/http-easy/private/session.rkt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
[make-session (->* []
3535
[#:pool-config pool-config?
3636
#:ssl-context (or/c #f ssl-client-context? (promise/c ssl-client-context?))
37-
#:cookie-jar (is-a?/c cookie-jar<%>)
37+
#:cookie-jar (or/c #f (is-a?/c cookie-jar<%>))
3838
#:proxies (listof proxy?)]
3939
session?)]
4040
[session? (-> any/c boolean?)]

http-easy-test/net/http-easy/http-easy.rkt

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -424,6 +424,15 @@
424424
(test-suite
425425
"session"
426426

427+
(test-suite
428+
"create"
429+
430+
(test-case "cookie jar can be #f"
431+
(check-true (session? (make-session #:cookie-jar #f))))
432+
433+
(test-case "cookie jar cannot be a symbol"
434+
(check-exn exn:fail:contract? (lambda () (make-session #:cookie-jar 'oops)))))
435+
427436
(test-suite
428437
"breaks"
429438

0 commit comments

Comments
 (0)