Repository navigation
Description
Summary. squirrel 0.0.108 reports Unknown sitemap format for gzip-compressed child sitemap files served as Content-Type: application/gzip without Content-Encoding. The same XML in an uncompressed child sitemap passes.
Data. This affects the sitemap layouts observed on or24.de and delife.de: all 15 child sitemaps on or24.de and the single child sitemap on delife.de were flagged.
The inspected or24.de child sitemap is served as application/gzip and decompresses to approximately 3 MB of well-formed XML (xmllint --noout exit 0). This check establishes XML well-formedness, not sitemap-schema validity.
Repro. Save the following as sitemap-repro.cjs. It serves a gzip fixture on port 8766 and an uncompressed control on port 8767. Both use the same sitemap XML, with URLs adjusted to their respective ports. The gzip response uses Content-Type: application/gzip without Content-Encoding.
const http = require('node:http');
const { gzipSync } = require('node:zlib');
for (const [port, compressed] of [[8766, true], [8767, false]]) {
const base = `http://127.0.0.1:${port}`;
const childPath = compressed ? '/child.xml.gz' : '/child.xml';
const namespace = 'http://www.sitemaps.org/schemas/sitemap/0.9';
const child = `<urlset xmlns="${namespace}"><url><loc>${base}/</loc></url></urlset>`;
const routes = {
'/': ['text/html; charset=utf-8', '<!doctype html><html lang="en"><head><title>Sitemap fixture</title></head><body>Fixture</body></html>'],
'/robots.txt': ['text/plain; charset=utf-8', `Sitemap: ${base}/sitemap.xml\n`],
'/sitemap.xml': ['application/xml; charset=utf-8', `<sitemapindex xmlns="${namespace}"><sitemap><loc>${base}${childPath}</loc></sitemap></sitemapindex>`],
[childPath]: compressed
? ['application/gzip', gzipSync(Buffer.from(child))]
: ['application/xml; charset=utf-8', child],
};
http.createServer((req, res) => {
const route = routes[req.url];
if (!route) {
res.writeHead(404);
return res.end();
}
res.writeHead(200, { 'Content-Type': route[0] });
res.end(route[1]);
}).listen(port, '127.0.0.1');
}node sitemap-repro.cjsIn another terminal:
squirrel --version
squirrel audit http://127.0.0.1:8766/ --http --refresh -m 2 -f json -o gzip.json --rule-include crawl/sitemap-valid
squirrel audit http://127.0.0.1:8767/ --http --refresh -m 2 -f json -o plain.json --rule-include crawl/sitemap-validActual (spark-onedot, 2026-10-11, squirrel 0.0.108): gzip → crawl/sitemap-valid, check sitemap-syntax, status fail, message 1 error(s) in 1 sitemap(s); child http://127.0.0.1:8766/child.xml.gz has Unknown sitemap format. Uncompressed control → issues: []; 1 URL discovered in the sitemap. Both audits crawled 1 page.
Expected: accept gzip-compressed child sitemap files permitted by the sitemap protocol. After HTTP content decoding, decompress a remaining gzip file before parsing its XML. The fixture must not produce Unknown sitemap format. This reproduction covers Content-Type: application/gzip without Content-Encoding; it does not establish a failure of HTTP gzip content decoding.
The sitemap protocol explicitly permits gzip files and shows .xml.gz children in a sitemap index.
Acceptance Criteria
- The gzip fixture from the repro (
application/gzip, noContent-Encoding,.xml.gzchild of a sitemap index) no longer producesUnknown sitemap format, and its URLs are discovered like the uncompressed control. - A body that starts with the gzip magic bytes is decompressed once, then parsed as XML; a sitemap served with
Content-Encoding: gzipstill works. - Decompression is bounded: output over the 50 MB uncompressed sitemap limit is refused with a clear error, so a gzip bomb cannot exhaust memory.
- A corrupt gzip body reports a specific error (not
Unknown sitemap format). - Tests cover gzip child, plain child, corrupt gzip and oversize.
Activity
nc9 commentedon Oct 11, 2026
Thanks Denis. Confirmed the source of the message:
Unknown sitemap formatcomes from the sitemap parser inpackages/crawler/src/sitemaps.ts, so this is a crawler fix, not a rule change (the rule just reports what the parser returns). Triaged as a bug (P2: it makes valid sitemap indexes read as broken), size S. I added acceptance criteria, including a bound on decompressed size so a gzip bomb cannot exhaust memory, and a distinct error for a corrupt gzip body.nc9 commentedon Oct 11, 2026
Reproduced on 0.0.108 with the repro script (ports changed). Gzip child:
crawl/sitemap-valid, checksitemap-syntax, statusfail,1 error(s) in 1 sitemap(s), itemhttp://127.0.0.1:8807/child.xml.gzlabelledUnknown sitemap format. The uncompressed control passes.origin/main still has this:
packages/crawler/src/sitemaps.tsreads every sitemap body withresponse.text()infetchSitemapand hands it toparseSitemapwith no check for gzip magic bytes, so the compressed bytes reach the XML parser as text.fix(crawler): report the zlib reason for corrupt deflate, test br/def…
fix(crawler): read a body that opens with markup as already decoded, …
fix(crawler): read gzip sitemaps within 50 MB, a guessed path that an…
nc9 commentedon Oct 12, 2026
Fixed in # and merged to main. Every acceptance criterion is met per the PR description, with before and after evidence from the CLI on local fixtures, tests that fail on the old code, and review comments triaged. Criteria ticked.