Redirect walker followups: hostname/port match + RFC 303 test docstring - #1868
Open
jacalata wants to merge 1 commit into
Open
Redirect walker followups: hostname/port match + RFC 303 test docstring#1868jacalata wants to merge 1 commit into
jacalata wants to merge 1 commit into
Conversation
Two adjustments from a post-merge fresh-eyes pass: - endpoint.py: the http -> https address-promotion match now compares hostnames case-insensitively (RFC 3986) and normalizes http://host vs http://host:80 so a same-host promotion doesn't silently drop. Split into two comparisons: current-vs-next is hostname-only (schemes differ so default port differs, comparing raw netloc would spuriously mismatch); old-address-vs-current is same-scheme and uses (hostname, effective port) so explicit-vs-implicit port compares equal. Expanded the auth-material comment to acknowledge that sign_in itself carries raw credentials in the POST body, not only the issued token on subsequent calls. - test_redirect_handling.py: added a docstring on test_all_supported_redirect_codes_preserve_post_body naming the RFC 7231 6.4.4 deviation on 303 -- if a future refactor "helpfully" converts 303 to GET, the parametrized test fails with a clear intent statement. Also considered a sign_in namespace-detect hedge for pre-8.3 Tableau responses (Copilot flagged this on #1848); dropped as theoretical because TSC's minimum_supported_server_version = 2.3 (Tableau 10.0, 2016) is eight years past the namespace change, and #1863 removes the whole subsystem anyway.
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.
Followup to #1848 (merged). Two small items from a post-merge
fresh-eyes review, kept off #1848 so the merged PR's approval + history
stayed clean.
Changes
endpoint.py: the http -> https address-promotion match nowcompares hostnames case-insensitively per RFC 3986 and normalizes
http://host vs http://host:80 so the same-host check doesn't
silently drop legitimate promotions. Rewritten as two comparisons:
current vs next (same-host across schemes, hostname only), and
old_address vs current (same-scheme, hostname+port with default-
port normalization). Also expanded the auth-material comment to
acknowledge that sign_in itself carries raw credentials (PAT
secret or username+password) in the POST body, not only the
issued token on subsequent calls.
test/test_redirect_handling.py: added a docstring ontest_all_supported_redirect_codes_preserve_post_bodynaming theRFC 7231 6.4.4 deviation on 303, so a future refactor that
"helpfully" converts 303 to GET fails this test with a clear
intent statement.
Test plan
test/test_redirect_handling.py: 26 passNot addressed here (per fresh-eyes review)
dropped as theoretical. TSC's
minimum_supported_server_version = 2.3(Tableau 10.0, 2016) is eight years past the namespacechange, and Proposed: Remove pre-8.3 XML namespace fallback #1863 removes the whole
Namespace.detectsubsystemanyway.
requestshas; [tabcmd] fix: preserve POST body across 3xx redirects (#1127, #1828) #1848's walker doesn't rewind non-seekable data. Separate
policy decision.
_blocking_requestdirectly, so the initial-request threadedprogress indicator is lost. Separate refactor.
🤖 Generated with Claude Code