summaryrefslogtreecommitdiffstats
path: root/krebs/3modules/go.nix
diff options
context:
space:
mode:
authormakefu <github@syntax-fehler.de>2022-01-26 17:59:53 +0100
committermakefu <github@syntax-fehler.de>2022-01-26 17:59:53 +0100
commit54aaf5af8ed4d62a2e6645b7ca662ffac310e86c (patch)
treeb3b1a1797791cd8cf763254a3fd88f7d35a2340c /krebs/3modules/go.nix
parentef48f536a3e539b215bb004b512e62c2d0f96907 (diff)
parent31fc5a95c735ab3b9b832d407195e422c07cd4c0 (diff)
Merge remote-tracking branch 'lass/master'
Diffstat (limited to 'krebs/3modules/go.nix')
-rw-r--r--krebs/3modules/go.nix12
1 files changed, 9 insertions, 3 deletions
diff --git a/krebs/3modules/go.nix b/krebs/3modules/go.nix
index fea25e03..80cd90e2 100644
--- a/krebs/3modules/go.nix
+++ b/krebs/3modules/go.nix
@@ -41,11 +41,17 @@ let
fi
;;
"POST /")
- uri=$(head -c "$req_content_length" \
+ uri_candidate=$(head -c "$req_content_length" \
| sed 's/+/ /g;s/%\(..\)/\\x\1/g;' \
| xargs -0 echo -e \
- | tee /tmp/tee.log \
- | ${pkgs.urix}/bin/urix \
+ )
+
+ if $(echo "$uri_candidate" | grep -q '^uri=//.*'); then
+ # fix urls with missing https: in front
+ uri_candidate=$(echo "$uri_candidate" | sed 's,//,https://,g')
+ fi
+
+ uri=$(echo "$uri_candidate" | ${pkgs.urix}/bin/urix \
| head -1 \
)