reamping the mardkwon
This commit is contained in:
@@ -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)"
|
||||
|
||||
Reference in New Issue
Block a user