From 84d6380081334de2a8ed858888f432274608f066 Mon Sep 17 00:00:00 2001 From: "Thomas (Tom) C. Gorordo" Date: Fri, 22 May 2026 04:09:27 -0700 Subject: [PATCH] allow source inspection of cgi script --- src/cgi/smithy.cgi | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/cgi/smithy.cgi b/src/cgi/smithy.cgi index 0b56d83..472ceb4 100755 --- a/src/cgi/smithy.cgi +++ b/src/cgi/smithy.cgi @@ -1,5 +1,15 @@ -#!/usr/bin/bash +#!/usr/bin/env bash SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" +if [[ "$QUERY_STRING" == "source" ]]; then + + echo "Content-Type: text/plain" + echo + echo "
"
+    sed 's/&/\&/g; s//\>/g' "$0"
+    echo "
" + exit 0 +fi + exec "$SCRIPT_DIR/../../.venv/bin/python" "$SCRIPT_DIR/script.py"