Regression: HTTP server would fail to serve files with binary encoding after Dan's io.encodings.iana changes from earlier today
parent
cd77ecfab3
commit
cb174f0db1
|
@ -1,6 +1,21 @@
|
||||||
USING: http http.server math sequences continuations tools.test ;
|
USING: http http.server math sequences continuations tools.test
|
||||||
|
io.encodings.utf8 io.encodings.binary accessors ;
|
||||||
IN: http.server.tests
|
IN: http.server.tests
|
||||||
|
|
||||||
[ t ] [ [ \ + first ] [ <500> ] recover response? ] unit-test
|
[ t ] [ [ \ + first ] [ <500> ] recover response? ] unit-test
|
||||||
|
|
||||||
\ make-http-error must-infer
|
\ make-http-error must-infer
|
||||||
|
|
||||||
|
[ "text/plain; charset=UTF-8" ] [
|
||||||
|
<response>
|
||||||
|
"text/plain" >>content-type
|
||||||
|
utf8 >>content-charset
|
||||||
|
unparse-content-type
|
||||||
|
] unit-test
|
||||||
|
|
||||||
|
[ "text/xml" ] [
|
||||||
|
<response>
|
||||||
|
"text/xml" >>content-type
|
||||||
|
binary >>content-charset
|
||||||
|
unparse-content-type
|
||||||
|
] unit-test
|
|
@ -97,10 +97,8 @@ GENERIC: write-full-response ( request response -- )
|
||||||
tri ;
|
tri ;
|
||||||
|
|
||||||
: unparse-content-type ( request -- content-type )
|
: unparse-content-type ( request -- content-type )
|
||||||
[ content-type>> "application/octet-stream" or ]
|
[ content-type>> "application/octet-stream" or ] [ content-charset>> ] bi
|
||||||
[ content-charset>> encoding>name ]
|
dup binary eq? [ drop ] [ encoding>name "; charset=" glue ] if ;
|
||||||
bi
|
|
||||||
[ "; charset=" glue ] when* ;
|
|
||||||
|
|
||||||
: ensure-domain ( cookie -- cookie )
|
: ensure-domain ( cookie -- cookie )
|
||||||
[
|
[
|
||||||
|
|
Loading…
Reference in New Issue