Repository navigation
[FEATURE] Conditional HTTP GET for Blacklist Downloads (ETag / Last-Modified) #3282 #3283
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
mkf-sysangels
wants to merge
14
commits into
bunkerity:dev
Choose a base branch
from
mkf-sysangels:FEATURE]-Conditional-HTTP-GET-for-Blacklist-Downloads-(ETag-/-Last-Modified)-#3282
base: dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+385
−49
Open
Changes from 10 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
96898e9
[FEATURE] Conditional HTTP GET for Blacklist Downloads (ETag / Last-M…
mkf-sysangels 463e944
change error messages to type error so the error icon will be visible
mkf-sysangels c7c1718
Copilot fixes
mkf-sysangels a23c130
after HEAD removal, nothing does meta["content_length"] for decisions…
mkf-sysangels 451f117
after HEAD removal, nothing does meta["content_length"] for decisions…
mkf-sysangels 1e4061c
RFC 7232 prefers both: ETag XOR Last-Modified (elif)
mkf-sysangels 8403813
Non-200 responses never resp.close() with stream=True
mkf-sysangels b7c15c5
Close the 200 response if parsing fails.
mkf-sysangels bea1ee8
Reject validators that contain newlines.
mkf-sysangels 921b4df
Log 304 at info, and count it separately.
mkf-sysangels b5e4f68
Merge remote-tracking branch 'upstream/dev' into FEATURE]-Conditional…
mkf-sysangels 99bec92
fix open code reviews
mkf-sysangels c21aede
fix(blacklist): keep a failed URL's last cached entries, extend condi…
mkf-sysangels b2b19b4
failed_urls stores only the URL and is shared across kinds. After one…
mkf-sysangels File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Script executed:
rg -n 'If-None-Match|If-Modified-Since|not_modified|304|last_update|parse_http_metadata|sanitize_validator|build_cache_header' tests/unit/jobs/test_lists_port_download.py tests src/common/core/blacklist/jobs/blacklist-download.pyRepository: bunkerity/bunkerweb
Length of output: 18717
Script executed:
Repository: bunkerity/bunkerweb
Length of output: 17947
Add tests for conditional headers and 304 handling.
The existing tests only cover the one-hour cache skip.
Cache.get_cache()returns the current time, so a second run does not send conditional headers. No test checks validator parsing, request headers, cached-entry reuse after304, or the304failure path without cached data.Add focused tests for
sanitize_validator,parse_http_metadata, andbuild_cache_header. Cover weak ETags, values containing\r, missing validators, and header-only cache data. Add downloader-entrypoint tests with an oldlast_updatethat assert both conditional headers, cached-entry reuse, thenot_modifiedrecap, and failure for304without cached data.