[Confluence] Keep the context path when following relative next links - #1685
Open
RizgarOzan wants to merge 1 commit into
Open
RizgarOzan wants to merge 1 commit into
RizgarOzan wants to merge 1 commit into
Conversation
On Server instances deployed under a context path (https://host/confluence), _get_paged built the second page URL from scheme+host only, so every page after the first went to https://host/rest/api/... Fixes atlassian-api#1668
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1685 +/- ##
=======================================
Coverage 65.15% 65.16%
=======================================
Files 106 106
Lines 19206 19210 +4
Branches 2085 2086 +1
=======================================
+ Hits 12514 12518 +4
Misses 6004 6004
Partials 688 688 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Fixes #1668
When Confluence Server runs under a context path (
https://host/confluence),_get_pagedresolved the relative_links.nextagainstscheme://netloconly, so every page after the first was requested fromhttps://host/rest/api/....Relative next links (
/rest/api/...andrest/api/...) are now joined under the context path fromself.url. If the link already starts with the context path it is left alone. This only applies to Server; the Cloud branch is unchanged, sincetest_pagination_with_relative_next_link_and_basepins the current Cloud behaviour and I didn't want to change that here.How I tested:
test_child_page_pagination_keeps_context_path(base URL with and without trailing slash, three next-link forms). On master 4 of the 6 cases fail withhttps://test.confluence.com/rest/api/...; with the fix all pass.pytest tests: 1720 passed, 10 skipped (master: 1714 passed, 10 skipped).base.py.