diff options
author | makefu <github@syntax-fehler.de> | 2020-09-16 21:55:09 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2020-09-16 21:55:09 +0200 |
commit | c64fb07027b49a3825b6f0814ebeb17782b8266a (patch) | |
tree | e1b4681fd93a4d3257b556dd8d579464d653ef77 /krebs/5pkgs/simple/htgen-imgur | |
parent | 1394ae1bd4bc3dcfb77b0daee996e75f8092fc5b (diff) | |
parent | 88a9183d1d36424977b0cd8ed513109433b779b2 (diff) |
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/5pkgs/simple/htgen-imgur')
-rw-r--r-- | krebs/5pkgs/simple/htgen-imgur/default.nix | 2 | ||||
-rw-r--r-- | krebs/5pkgs/simple/htgen-imgur/src/htgen-imgur | 20 |
2 files changed, 13 insertions, 9 deletions
diff --git a/krebs/5pkgs/simple/htgen-imgur/default.nix b/krebs/5pkgs/simple/htgen-imgur/default.nix index fe0b2ab04..f909cb98b 100644 --- a/krebs/5pkgs/simple/htgen-imgur/default.nix +++ b/krebs/5pkgs/simple/htgen-imgur/default.nix @@ -2,7 +2,7 @@ with import <stockholm/lib>; { attr, coreutils, exiv2, findutils, gnugrep, jq, nix, utillinux, stdenv }: stdenv.mkDerivation rec { pname = "htgen-imgur"; - version = "1.0.0"; + version = "1.1.0"; src = ./src; diff --git a/krebs/5pkgs/simple/htgen-imgur/src/htgen-imgur b/krebs/5pkgs/simple/htgen-imgur/src/htgen-imgur index af092d007..f30265ba7 100644 --- a/krebs/5pkgs/simple/htgen-imgur/src/htgen-imgur +++ b/krebs/5pkgs/simple/htgen-imgur/src/htgen-imgur @@ -27,13 +27,15 @@ basic_response() {( } ') - printf "HTTP/1.1 $status_code $status_reason\r\n" - printf 'Connection: close\r\n' - printf 'Content-Length: %d\r\n' $(expr ${#response_body} + 1) - printf 'Content-Type: application/json; charset=UTF-8\r\n' - printf 'Server: %s\r\n' "$Server" - printf '\r\n' - printf '%s\n' "$response_body" + if test "$HTGEN_VERBOSE" = true; then + printf "HTTP/1.1 $status_code $status_reason\r\n" + printf 'Connection: close\r\n' + printf 'Content-Length: %d\r\n' $(expr ${#response_body} + 1) + printf 'Content-Type: application/json; charset=UTF-8\r\n' + printf 'Server: %s\r\n' "$Server" + printf '\r\n' + printf '%s\n' "$response_body" + fi )} @@ -78,7 +80,9 @@ case "$Method $path" in trap "rm $content >&2" EXIT case ${req_expect-} in 100-continue) - printf 'HTTP/1.1 100 Continue\r\n\r\n' + if test "$HTGEN_VERBOSE" = true; then + printf 'HTTP/1.1 100 Continue\r\n\r\n' + fi esac head -c $req_content_length > $content |