Repository navigation
Conversation
tobocop2
force-pushed
the
fix/sitemap-urlset-loc-normalized
branch
from
September 27, 2026 02:04
81017a4 to
3fe37b0
Compare
Goldziher
force-pushed
the
fix/sitemap-parse-child-loc
branch
from
September 27, 2026 08:33
1051446 to
d3064ed
Compare
Goldziher
force-pushed
the
fix/sitemap-urlset-loc-normalized
branch
from
September 27, 2026 08:33
3fe37b0 to
d6095f6
Compare
map() returned each urlset <loc> as the trimmed raw text. Two spellings of one page (an upper-case scheme or host, a default port, an embedded tab or newline) came back as two entries, a relative <loc> came back as a bare path, and a <loc> that is not an address came back as text. Every urlset consumer (the leaf of a sitemap walk and a urlset or gzip fetched directly) now goes through one collector. It resolves each <loc> against the sitemap's own URL with the resolver sitemap-index children use, without their host rewrite, so an entry on another host stays on that host. A <loc> that does not parse is dropped and logged by length; the sitemap URL is logged redacted when it parses and by length when it does not, through the log helper the index-child path now shares. Entries are deduplicated on the parsed address across every document of one map() call: the walk context, created once per call, holds the set behind a mutex that is only locked in synchronous code. A duplicate is dropped before it counts toward map_limit. A relative <loc> now resolves to an address, so exclude_paths applies to it, and map_search matches the normalized address rather than the raw spelling. Closes #323
Goldziher
force-pushed
the
fix/sitemap-parse-child-loc
branch
from
September 27, 2026 08:53
d3064ed to
00f050c
Compare
Goldziher
force-pushed
the
fix/sitemap-urlset-loc-normalized
branch
from
September 27, 2026 08:53
d6095f6 to
1ab54b8
Compare
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Stacked on #303.
Problem
map()returned each sitemap<loc>as raw text.https://example.com/aandHTTPS://example.com:443/acame back as two entries. A relative<loc>came back as a bare path, and a<loc>that is not an address came back as text.Normalized entries
Each
<loc>is now resolved against the sitemap's own URL with the parser that sitemap-index children use, and it is returned in its normalized form. An entry on another host stays on that host.Unparseable entries
A
<loc>that does not parse is dropped. The log records its length, never its value.Duplicates
An address is returned once per
map()call, also when several sitemaps list it. A duplicate does not count towardmap_limit.Changed filtering
A relative
<loc>now resolves to an address, soexclude_pathsapplies to it.map_searchnow matches the normalized address, so a search for a raw spelling (a default port, or non-ASCII text in the path or host) no longer matches; #338 tracks matching non-ASCII terms.Local verification
cargo fmt --check, workspace clippy with--all-features --all-targets -D warnings,cargo test -p crawlberg --all-features(851 lib tests pass) and the wasm32 check all pass.Closes #323