Fix PR 14140
This commit is contained in:
parent
ad6237f76e
commit
b61198ec3f
|
@ -155,4 +155,13 @@
|
||||||
#"GET / HTTP/1.1\r\nHost: localhost:REDACTED\r\nAccept-Encoding: gzip\r\n\r\n"
|
#"GET / HTTP/1.1\r\nHost: localhost:REDACTED\r\nAccept-Encoding: gzip\r\n\r\n"
|
||||||
#"HTTP/1.1 200 OK"
|
#"HTTP/1.1 200 OK"
|
||||||
'(#"Content-Type: text/plain" #"Transfer-Encoding: chunked" #"Another-Header: ta-daa")
|
'(#"Content-Type: text/plain" #"Transfer-Encoding: chunked" #"Another-Header: ta-daa")
|
||||||
#"This is the data in the first chand this is the second oneXXXXXXX"]))
|
#"This is the data in the first chand this is the second oneXXXXXXX"]
|
||||||
|
|
||||||
|
["HTTP/1.1 200 OK\r\nContent-Type: text/plain\r\nTransfer-Encoding: chunked\r\nAnother-Header: ta-daa\r\n\r\nbb \r\n<HTML>\n\t\t\t\t\t <HEAD>\n\t\t\t\t\t <TITLE>ABCNANOTECH Co., LTD.</TITLE>\n\t\t\t\t\t </HEAD>\n\t\t\t\t\t <FRAMESET ROWS=\"100%,*\" border=0>\n\t\t\t\t\t <FRAME src=http://nanotech.co.kr></FRAMESET>\n\t\t\t\t\t </HTML>\r\n0\r\n\r\n"
|
||||||
|
#"GET / HTTP/1.1\r\nHost: localhost:REDACTED\r\nAccept-Encoding: gzip\r\n\r\n"
|
||||||
|
#"HTTP/1.1 200 OK"
|
||||||
|
'(#"Content-Type: text/plain" #"Transfer-Encoding: chunked" #"Another-Header: ta-daa")
|
||||||
|
#"<HTML>\n\t\t\t\t\t <HEAD>\n\t\t\t\t\t <TITLE>ABCNANOTECH Co., LTD.</TITLE>\n\t\t\t\t\t </HEAD>\n\t\t\t\t\t <FRAMESET ROWS=\"100%,*\" border=0>\n\t\t\t\t\t <FRAME src=http://nanotech.co.kr></FRAMESET>\n\t\t\t\t\t </HTML>"]))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,6 +2,7 @@
|
||||||
(require racket/contract/base
|
(require racket/contract/base
|
||||||
racket/match
|
racket/match
|
||||||
racket/list
|
racket/list
|
||||||
|
racket/string
|
||||||
racket/port
|
racket/port
|
||||||
(rename-in racket/tcp
|
(rename-in racket/tcp
|
||||||
[tcp-connect plain-tcp-connect]
|
[tcp-connect plain-tcp-connect]
|
||||||
|
@ -147,10 +148,12 @@
|
||||||
(define (http-pipe-chunk ip op)
|
(define (http-pipe-chunk ip op)
|
||||||
(define crlf-bytes (make-bytes 2))
|
(define crlf-bytes (make-bytes 2))
|
||||||
(let loop ([last-bytes #f])
|
(let loop ([last-bytes #f])
|
||||||
(define size-str (read-line ip 'return-linefeed))
|
(define size-str (string-trim (read-line ip 'return-linefeed)))
|
||||||
(define chunk-size (string->number size-str 16))
|
(define chunk-size (string->number size-str 16))
|
||||||
(unless chunk-size
|
(unless chunk-size
|
||||||
(error 'http-conn-response/chunked "Could not parse ~S as hexadecimal number" size-str))
|
(error 'http-conn-response/chunked
|
||||||
|
"Could not parse ~S as hexadecimal number"
|
||||||
|
size-str))
|
||||||
(define use-last-bytes?
|
(define use-last-bytes?
|
||||||
(and last-bytes (<= chunk-size (bytes-length last-bytes))))
|
(and last-bytes (<= chunk-size (bytes-length last-bytes))))
|
||||||
(if (zero? chunk-size)
|
(if (zero? chunk-size)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user