Skip to content

Commit 208e148

Browse files
committed
Remove some formatting
1 parent fd0dea1 commit 208e148

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

shiggy.sh

+2-6
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ function dbg() {
1111
}
1212
self="$0"
1313
read -r method path http
14-
dbg test
1514

1615
source_ip=unknown
1716
while read -r line; do
@@ -43,7 +42,6 @@ function content_type() {
4342

4443
function content_length() {
4544
echo "Content-Length: $1"
46-
dbg "Sending content length of $1"
4745
}
4846

4947
function end_headers() {
@@ -56,11 +54,9 @@ function resolve_file() {
5654

5755
function send_file() {
5856
filename="$(resolve_file "$1")"
59-
dbg Trying to send "$filename"
6057
content_length $(wc -c "$filename" | cut -d ' ' -f 1)
6158
end_headers
6259
cat <"$filename"
63-
dbg Finished sending file
6460
}
6561

6662
function send_heredoc() {
@@ -81,6 +77,7 @@ function send_file_if_exists() {
8177
}
8278

8379
function send_404() {
80+
dbg 404 hit by $source_ip
8481
begin_response 404 "Not Found"
8582
content_type "text/html"
8683
send_heredoc <<-'EOF'
@@ -163,7 +160,7 @@ case "$path" in
163160
}
164161
'
165162
json="$(jq -n --arg report "Shiggy # $shiggy_id has been reported" --arg ip "$source_ip" "$structure")"
166-
curl $REPORT_WEBHOOK -X POST -H "Content-Type: multipart/form-data" -F "payload_json=$json" -F'files[0]=@'"posts/$shiggy_id;filename=SPOILER_shiggy.png">&2
163+
curl $REPORT_WEBHOOK -X POST -H "Content-Type: multipart/form-data" -F "payload_json=$json" -F'files[0]=@'"posts/$shiggy_id;filename=SPOILER_shiggy.png" >&2
167164
begin_response 200 Found
168165
content_type text/html
169166
send_heredoc <<EOF
@@ -214,7 +211,6 @@ EOF
214211
send_file 404.png
215212
;;
216213
*)
217-
dbg "$path" does not match what i expected
218214
send_404
219215
;;
220216
esac

0 commit comments

Comments
 (0)