Repository navigation
Conversation
FetcherBolt.discoverSitemaps() sets foundSitemap=true on the metadata of the URL being fetched, so SitemapFilter rejected its redirect target whenever robots.txt declared a sitemap. Filter redirect targets with a copy of the metadata without foundSitemap: in the protocol (redirects followed by okhttp), for REDIRECTION outlinks in FetcherBolt and SimpleFetcherBolt, and for meta refresh redirects in JSoupParserBolt. Outlinks of the page are still filtered as before.
dpol1
approved these changes
Oct 29, 2026
dpol1
left a comment
Contributor
There was a problem hiding this comment.
Could we also assert foundSitemap on the parse tuple in redirectIsFollowedByProtocolWithSitemapFilter? That would cover SimpleFetcherBolt too.
Contributor
Author
|
Good point, added. Thanks! |
This branch has not been deployed
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.
FetcherBolt.discoverSitemaps()setsfoundSitemap=trueon the metadata of the URL being fetched, before the fetch. Redirect targets were then filtered with that metadata, andSitemapFilterrejects every URL whenfoundSitemap=trueandisSitemapis not set. As a result, the redirect target of any URL on a site whose robots.txt declares a sitemap never reached the status store.Changes:
StatusEmitterBolt.redirectMetadata(Metadata), which returns a copy of the metadata withoutfoundSitemapif it is present.protocol.getProtocolOutputinFetcherBoltandSimpleFetcherBolt(okhttp filters each redirect hop with it since Run redirect hops through the URL filters #2128), for theREDIRECTIONoutlinks emitted by both fetcher bolts, and for meta refresh redirects inJSoupParserBolt.foundSitemap, soSitemapFilterstill applies to the page's outlinks.Tests:
AbstractFetcherBoltTest(runs forFetcherBoltandSimpleFetcherBolt): a 301 with onlySitemapFilterin the chain, with and without aSitemap:line in robots.txt, forhttp.allow.redirectsfalse and true. The "with sitemap" cases fail on main.JSoupParserBoltTest.testHTMLRedirWithSitemapFilter: meta refresh withfoundSitemap=true. Fails on main.SitemapFilterTestfor the outlink behaviour that has to stay.Fixes #2282