reamping the mardkwon

This commit is contained in:
Anaïs Saraiva
2026-08-15 10:49:26 +02:00
parent 4867cf57b6
commit e97eddbc1a
3 changed files with 85 additions and 15 deletions
+7 -2
View File
@@ -50,8 +50,13 @@ dd if=/dev/urandom of="$TMP/random.bin" bs=1M count=16 2>/dev/null
check "health endpoint" curl -sS -f "$BASE/api/health" >/dev/null
check "upload without password is rejected (400)" test \
"$(curl -sS -o /dev/null -w '%{http_code}' -F "file=@$TMP/plain.txt" "$BASE/api/upload")" = "400"
curl -sS -F "file=@$TMP/plain.txt" "$BASE/api/upload" > "$TMP/pub.json"
PUB_ID="$(get "$TMP/pub.json" id)"
check "upload without password succeeds" test -n "$PUB_ID"
check "upload without password is public" test "$(get "$TMP/pub.json" protected)" = "false"
curl -sS -o "$TMP/pubdown.txt" "$BASE$(get "$TMP/pub.json" url)"
check "public file downloads directly" cmp "$TMP/plain.txt" "$TMP/pubdown.txt"
curl -sS -f -X DELETE -H "X-Delete-Key: $PUB_ID" "$BASE/api/files/$PUB_ID" >/dev/null
up "$TMP/plain.txt" > "$TMP/up.json"
KEY="$(get "$TMP/up.json" key)"