parent
a85b25865a
commit
90528c1408
|
@ -2,7 +2,7 @@ with import <stockholm/lib>;
|
||||||
{ attr, coreutils, exiv2, findutils, gnugrep, jq, nix, utillinux, stdenv }:
|
{ attr, coreutils, exiv2, findutils, gnugrep, jq, nix, utillinux, stdenv }:
|
||||||
stdenv.mkDerivation rec {
|
stdenv.mkDerivation rec {
|
||||||
pname = "htgen-imgur";
|
pname = "htgen-imgur";
|
||||||
version = "1.1.0";
|
version = "1.0.0";
|
||||||
|
|
||||||
src = ./src;
|
src = ./src;
|
||||||
|
|
||||||
|
|
|
@ -27,15 +27,13 @@ basic_response() {(
|
||||||
}
|
}
|
||||||
')
|
')
|
||||||
|
|
||||||
if test "$HTGEN_VERBOSE" = true; then
|
printf "HTTP/1.1 $status_code $status_reason\r\n"
|
||||||
printf "HTTP/1.1 $status_code $status_reason\r\n"
|
printf 'Connection: close\r\n'
|
||||||
printf 'Connection: close\r\n'
|
printf 'Content-Length: %d\r\n' $(expr ${#response_body} + 1)
|
||||||
printf 'Content-Length: %d\r\n' $(expr ${#response_body} + 1)
|
printf 'Content-Type: application/json; charset=UTF-8\r\n'
|
||||||
printf 'Content-Type: application/json; charset=UTF-8\r\n'
|
printf 'Server: %s\r\n' "$Server"
|
||||||
printf 'Server: %s\r\n' "$Server"
|
printf '\r\n'
|
||||||
printf '\r\n'
|
printf '%s\n' "$response_body"
|
||||||
printf '%s\n' "$response_body"
|
|
||||||
fi
|
|
||||||
|
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
@ -80,9 +78,7 @@ case "$Method $path" in
|
||||||
trap "rm $content >&2" EXIT
|
trap "rm $content >&2" EXIT
|
||||||
|
|
||||||
case ${req_expect-} in 100-continue)
|
case ${req_expect-} in 100-continue)
|
||||||
if test "$HTGEN_VERBOSE" = true; then
|
printf 'HTTP/1.1 100 Continue\r\n\r\n'
|
||||||
printf 'HTTP/1.1 100 Continue\r\n\r\n'
|
|
||||||
fi
|
|
||||||
esac
|
esac
|
||||||
|
|
||||||
head -c $req_content_length > $content
|
head -c $req_content_length > $content
|
||||||
|
|
Loading…
Reference in a new issue