Fix _extract_base_url stripping context path for Server/DC instances#168
Merged
Spenhouet merged 1 commit intoSpenhouet:mainfrom Apr 7, 2026
Merged
Conversation
Server/Data Center instances deployed under a context path (e.g. /confluence) need that path preserved in the base URL for correct SDK endpoint resolution and auth config lookup. Split URL path into segments and stop at the first known Confluence route segment (wiki, display, spaces, rest, etc.), keeping everything before it as the context path.
3d4a86d to
0046360
Compare
Owner
|
@MathurinV Thanks for your PR! |
Owner
|
@MathurinV Just a note: I tested
and it will parse "host" as the schema, which will not work when constructing the URL. I don't think that's a big issue but your Test Plan stated
so it might be something you expected to work? |
Owner
|
@MathurinV I pushed some further improvements to provide more guidance on providing a correct URL in version 4.0.3. Please check it out. |
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.
Summary
Server/Data Center instances deployed under a context path (e.g.
/confluence) need that path preserved in the base URL for correct SDK endpoint resolution and auth config lookup.The fix splits the URL path into segments and stops at the first known Confluence route segment (
wiki,display,spaces,rest,pages,plugins,dosearchsite.action), keeping everything before it as the context path. Cloud URLs (*.atlassian.net) and API gateway URLs are unaffected.Fixes #167
Test Plan
https://host/confluence/spaces/KEY→ extractshttps://host/confluencecompany.atlassian.net/wiki/spaces/KEY) still extracthttps://company.atlassian.nethost:8090/confluence/display/PROJ) →https://host:8090/confluencehost/myapp/confluence/wiki/spaces/KEY) →https://host/myapp/confluence