Skip to content

Commit

Permalink
update typed/web-server/http for v1.6 (typed-racket-more v1.13)
Browse files Browse the repository at this point in the history
- Add types related to `binding:file/port-in`.

- Add comments noting the non-changes to `valid-id-cookie?`
  and related functions.
  • Loading branch information
LiberalArtist authored and samth committed Jan 16, 2020
1 parent 1b15186 commit 6a20940
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 4 deletions.
Expand Up @@ -255,6 +255,9 @@ and the @racket[URL] and @racket[Path/Param] types from
#:changed "1.11"
@elem{Updated to reflect @racketmodname[web-server/http]
version 1.4.}
#:changed "1.13"
@elem{Updated to reflect @racketmodname[web-server/http]
version 1.6.}
]

@defmodule/incl[typed/db]
Expand Down
4 changes: 2 additions & 2 deletions typed-racket-more/info.rkt
Expand Up @@ -6,7 +6,7 @@
"base"
"net-lib"
"net-cookies-lib"
["web-server-lib" #:version "1.5"]
["web-server-lib" #:version "1.6"]
["db-lib" #:version "1.5"]
"draw-lib"
"rackunit-lib"
Expand All @@ -27,4 +27,4 @@

(define pkg-authors '(samth stamourv))

(define version "1.12")
(define version "1.13")
15 changes: 13 additions & 2 deletions typed-racket-more/typed/web-server/http.rkt
Expand Up @@ -31,6 +31,13 @@
[headers : (Listof Header)]
[content : Bytes])
#:extra-constructor-name make-binding:file]
;; It would be better if we could tell Typed Racket
;; that `binding:file/port` is a subtype of `binding:file`.
[#:opaque binding:file/port binding:file/port?]
[binding:file/port-in (-> binding:file/port Input-Port)]
[make-binding:file/port
(-> Bytes Bytes (Listof Header) Input-Port
binding:file/port)]
[#:struct request
([method : Bytes]
[uri : URL]
Expand Down Expand Up @@ -107,6 +114,10 @@
Cookie-Value
Valid-Domain)

;; N.B.: The untyped cookie functions will implicitly convert bytes to
;; strings on input, partially for compatability, but that doesn't seem
;; very desirable in a typed context.

(require/typed/provide
web-server/http/cookie
[make-cookie
Expand Down Expand Up @@ -145,14 +156,14 @@
(-> String
Bytes
Request
[#:timeout Number]
[#:timeout Number] ;; should have been Real
[#:shelf-life Real]
(Option String))]
[valid-id-cookie?
(-> Any ;; yes, this is really Any
#:name String
#:key Bytes
[#:timeout Number]
[#:timeout Number] ;; should have been Real
[#:shelf-life Real]
(Option String))]
[logout-id-cookie
Expand Down

1 comment on commit 6a20940

@racket-discourse-github-bot

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This commit has been mentioned on Racket Discussions. There might be relevant details there:

https://racket.discourse.group/t/simple-overview-of-how-packages-dependencies-work-in-racket/741/6

Please sign in to comment.