Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http 1.1 #62

Draft
wants to merge 4 commits into
base: hello-schemer
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
422 changes: 422 additions & 0 deletions live/net/http11/body.scm

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions live/net/http11/checks/request/template/COPYING
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

20 changes: 20 additions & 0 deletions live/net/http11/checks/request/template/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#;/usr/bin/env -S scheme-live run

;; Local Variables:
;; mode: scheme
;; End:

(import (scheme base))
(import (scheme process-context))
(import (live http helpers))
(import (live http unstable))


(define input (read-bytevector-from-file "input.bin"))
(define expected (read-from-file "expected.scm"))
(define actual (http-request-read* input))


(if (equal? expected actual)
(exit 0)
(exit 1))
Empty file.
Empty file.
1 change: 1 addition & 0 deletions live/net/http11/checks/response/998/.#check
45 changes: 45 additions & 0 deletions live/net/http11/checks/response/998/check
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#;/usr/bin/env -S scheme-live run

;; Local Variables:
;; mode: scheme
;; End:

(import (scheme base))
(import (scheme file))
(import (scheme process-context))
(import (live net http11 helpers))
(import (live net http11 unstable))


(define (pk . args)
(write args)
(car (reverse args)))

(define (read-bytevector-from-file filename)
(define port (open-binary-input-file filename))
(let loop ((out '()))
(let ((byte (read-u8 port)))
(if (eof-object? byte)
(begin
(close-port port)
(apply bytevector (reverse out)))
(loop (cons byte out))))))

(define (read-from-file filename)
(call-with-input-file filename read))

(define (http-response-read/chunks input)
(call-with-values (lambda () (http-response-read input))
(lambda (version code reason headers body)
(list version code reason headers (generator->list body)))))

(define input (read-bytevector-from-file "input.bin"))
(define expected (read-from-file "expected.scm"))
(define expected-star (read-from-file "expected-star.scm"))

(define actual (http-response-read input))


(if (equal? expected actual)
(exit 0)
(exit 1))
Empty file.
Loading