diff options
author | lassulus <git@lassul.us> | 2023-07-30 21:42:56 +0200 |
---|---|---|
committer | lassulus <git@lassul.us> | 2023-07-30 21:42:56 +0200 |
commit | 6e63efa3645353bc0549f5f152ef811fff5d644c (patch) | |
tree | 420a283a3a6782ac3712aaead039676b82de58b6 /krebs/5pkgs/simple | |
parent | d8cdda91e3c8027ed8a057649b32e2a00d4abaf9 (diff) |
htgen-paste: add DELETE
Diffstat (limited to 'krebs/5pkgs/simple')
-rw-r--r-- | krebs/5pkgs/simple/htgen-paste/src/htgen-paste | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/krebs/5pkgs/simple/htgen-paste/src/htgen-paste b/krebs/5pkgs/simple/htgen-paste/src/htgen-paste index 74266e53a..9d57d07ee 100644 --- a/krebs/5pkgs/simple/htgen-paste/src/htgen-paste +++ b/krebs/5pkgs/simple/htgen-paste/src/htgen-paste @@ -22,7 +22,17 @@ case "$Method $abs_path" in printf 'Connection: close\r\n' printf 'Content-Length: %d\r\n' $(wc -c < $item) printf '\r\n' - cat $item + cat "$item" + exit + fi + ;; + "DELETE /"[0-9a-z]*) + if item=$(find_item ${abs_path#/}); then + printf 'HTTP/1.1 200 OK\r\n' + printf 'Server: %s\r\n' "$Server" + printf 'Connection: close\r\n' + printf '\r\n' + rm "$item" exit fi ;; |