change html type to raw

This commit is contained in:
Adrien Abraham 2022-09-02 18:52:13 +02:00
parent cdf6957c1e
commit 962a06fa70
2 changed files with 1 additions and 7 deletions

View file

@ -1,6 +0,0 @@
#!/bin/bash
# Share a text file to shrlok.
cat <(printf '{"type":"txt"}\0') "$1" \
| socat - UNIX-CONNECT:/run/shrlok/shr.sock \
| sed 's|/var/www/files|https://files.dece.space|' \
; echo

View file

@ -67,7 +67,7 @@ class Handler(socketserver.StreamRequestHandler):
file_name = None
if header.get("type") == "txt":
file_name = write_text(data, title=header.get("title"))
elif header.get("type") == "html":
elif header.get("type") == "raw":
file_name = write_content(data)
else:
print("Unknown type.")