GET /zip
/zipReturns a well-formed STORED ZIP archive: single entry hello.txt, correct CRC32, declared sizes match the body, central directory entries agree with the local file header, EOCD present. Counterpart to the chaos /zip endpoint, which deliberately ships archives where one structural field lies.
expect: 200 OK with Content-Type: application/zip. Single STORED entry, correct CRC, coherent central directory and EOCD. Every conformant extractor accepts the archive cleanly.
# Save the archive, then unzip and check for CRC errors / structural complaints.
curl -sD - 'https://not.catastrophic.io/zip' -o /tmp/chaos.zip | grep -i 'content-type\|x-chaos-zip'
unzip -l /tmp/chaos.zip
unzip -t /tmp/chaos.zip
import urllib.request, zipfile, io
resp = urllib.request.urlopen("https://not.catastrophic.io/zip")
raw = resp.read()
print("Content-Type:", resp.headers.get("Content-Type"))
print("X-Chaos-Zip-Mode:", resp.headers.get("X-Chaos-Zip-Mode"))
print("X-Chaos-Zip-Note:", resp.headers.get("X-Chaos-Zip-Note"))
try:
zf = zipfile.ZipFile(io.BytesIO(raw))
print("Entries:", zf.namelist())
bad = zf.testzip()
print("Failed CRC on:", bad)
except zipfile.BadZipFile as e:
print("BadZipFile:", e)
// Inspect headers and the first few bytes of the archive.
const res = await fetch("https://not.catastrophic.io/zip");
const bytes = new Uint8Array(await res.arrayBuffer());
console.log("Content-Type:", res.headers.get("content-type"));
console.log("X-Chaos-Zip-Note:", res.headers.get("x-chaos-zip-note"));
const magic = Array.from(bytes.slice(0, 4))
.map(b => b.toString(16).padStart(2, "0")).join("");
console.log("First 4 bytes (504b0304 = LFH signature):", magic);
package main
import (
"archive/zip"
"bytes"
"fmt"
"io"
"net/http"
)
func main() {
resp, _ := http.Get("https://not.catastrophic.io/zip")
defer resp.Body.Close()
body, _ := io.ReadAll(resp.Body)
fmt.Println("Content-Type:", resp.Header.Get("Content-Type"))
fmt.Println("X-Chaos-Zip-Note:", resp.Header.Get("X-Chaos-Zip-Note"))
r, err := zip.NewReader(bytes.NewReader(body), int64(len(body)))
if err != nil {
fmt.Println("zip.NewReader error:", err)
return
}
for _, f := range r.File {
fmt.Printf(" %s declared=%d crc=%08x\n", f.Name, f.UncompressedSize64, f.CRC32)
}
}
// Cargo.toml: reqwest = { version = "0.12", features = ["blocking"] }
// zip = "2"
use std::io::Cursor;
fn main() -> Result<(), Box> {
let resp = reqwest::blocking::get("https://not.catastrophic.io/zip")?;
println!("Content-Type: {:?}", resp.headers().get("content-type"));
println!("X-Chaos-Zip-Note: {:?}", resp.headers().get("x-chaos-zip-note"));
let bytes = resp.bytes()?;
match zip::ZipArchive::new(Cursor::new(bytes.to_vec())) {
Ok(mut zf) => {
for i in 0..zf.len() {
let f = zf.by_index(i)?;
println!(" {} declared={} crc={:08x}", f.name(), f.size(), f.crc32());
}
}
Err(e) => println!("ZipArchive error: {}", e),
}
Ok(())
}
// Java 11+ HttpClient + java.util.zip.
import java.net.URI;
import java.net.http.*;
import java.util.zip.*;
import java.io.*;
public class ZipChaos {
public static void main(String[] args) throws Exception {
var client = HttpClient.newHttpClient();
var req = HttpRequest.newBuilder(URI.create("https://not.catastrophic.io/zip")).build();
var resp = client.send(req, HttpResponse.BodyHandlers.ofByteArray());
System.out.println("Content-Type: " +
resp.headers().firstValue("Content-Type").orElse(""));
System.out.println("X-Chaos-Zip-Note: " +
resp.headers().firstValue("X-Chaos-Zip-Note").orElse(""));
try (var zis = new ZipInputStream(new ByteArrayInputStream(resp.body()))) {
ZipEntry e;
while ((e = zis.getNextEntry()) != null) {
System.out.printf(" %s declared=%d crc=%08x%n",
e.getName(), e.getSize(), e.getCrc());
}
} catch (ZipException ze) {
System.out.println("ZipException: " + ze.getMessage());
}
}
}
using System.IO.Compression;
using var client = new HttpClient();
var resp = await client.GetAsync("https://not.catastrophic.io/zip");
Console.WriteLine($"Content-Type: {resp.Content.Headers.ContentType}");
Console.WriteLine($"X-Chaos-Zip-Note: {resp.Headers.GetValues("X-Chaos-Zip-Note").FirstOrDefault()}");
var bytes = await resp.Content.ReadAsByteArrayAsync();
try {
using var zf = new ZipArchive(new MemoryStream(bytes), ZipArchiveMode.Read);
foreach (var e in zf.Entries) {
Console.WriteLine($" {e.FullName} declared={e.Length} crc={e.Crc32:x8}");
}
} catch (InvalidDataException ex) {
Console.WriteLine($"InvalidDataException: {ex.Message}");
}
require "net/http"
require "tempfile"
uri = URI("https://not.catastrophic.io/zip")
Net::HTTP.start(uri.host, uri.port, use_ssl: true) do |http|
res = http.get(uri.request_uri)
puts "Content-Type: #{res['Content-Type']}"
puts "X-Chaos-Zip-Note: #{res['X-Chaos-Zip-Note']}"
Tempfile.create(["chaos", ".zip"]) do |f|
f.binmode; f.write(res.body); f.flush
puts `unzip -l #{f.path} 2>&1`
end
end
# Invoke-WebRequest -OutFile saves the archive, then Expand-Archive checks structure.
$tmp = Join-Path $env:TEMP 'chaos.zip'
$r = Invoke-WebRequest -Uri 'https://not.catastrophic.io/zip' -OutFile $tmp -PassThru
"Content-Type: $($r.Headers['Content-Type'])"
"X-Chaos-Zip-Note: $($r.Headers['X-Chaos-Zip-Note'])"
try {
$dst = Join-Path $env:TEMP ('chaos-out-' + [Guid]::NewGuid())
Expand-Archive -Path $tmp -DestinationPath $dst -ErrorAction Stop
Get-ChildItem $dst | Format-Table Name, Length
} catch {
"Expand-Archive failed: $($_.Exception.Message)"
}
headers
body