diff --git a/regress/Makefile b/regress/Makefile index a7b693c..195cb0d 100644 --- a/regress/Makefile +++ b/regress/Makefile @@ -33,7 +33,7 @@ testdata: fill-file ./sha testdata/bigfile testdata/bigfile.sha printf "# hello world\n" > testdata/index.gmi ./sha testdata/index.gmi testdata/index.gmi.sha - cp hello slow err invalid testdata/ + cp hello slow err invalid serve-bigfile testdata/ mkdir testdata/dir cp testdata/index.gmi testdata/dir/foo.gmi diff --git a/regress/runtime b/regress/runtime index 6e62029..6456746 100755 --- a/regress/runtime +++ b/regress/runtime @@ -171,6 +171,13 @@ echo OK GET /err with cgi eq "$(raw /invalid | wc -c | xargs)" 2048 "Unexpected body for /invalid" echo OK GET /invalid with cgi +# try a big file +eq "$(head /serve-bigfile)" "20 application/octet-stream" "Unexpected head for /serve-bigfile" +get /bigfile > bigfile +./sha bigfile bigfile.sha +eq "$(cat bigfile.sha)" "$(cat testdata/bigfile.sha)" "Unexpected sha for /serve-bigfile" +echo OK GET /serve-bigfile with cgi + check "should be running" quit diff --git a/regress/serve-bigfile b/regress/serve-bigfile new file mode 100644 index 0000000..56fb488 --- /dev/null +++ b/regress/serve-bigfile @@ -0,0 +1,5 @@ +#!/bin/sh + +printf "20 application/octet-stream\r\n" + +exec cat bigfile