Skip to content
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

Fix adding x-requested-with header for relative URLs in some cases #41632

Merged
merged 2 commits into from Nov 24, 2023

Conversation

julien-nc
Copy link
Member

When NC is at the root path of the web server, getRootUrl() returns an empty string and isNextcloudUrl() always returned true for relative URLs.

The condition to know if a URL points to NC is now:

  • the URL starts with the absolute NC base URL (this implicitly checks if the URL is absolute)
  • OR the URL is relative and start with NC's root URL (the sub path)

This broke the OpenStreetMap integration in instances that are accessible at the root of the webserver.

@julien-nc julien-nc added bug 3. to review Waiting for reviews labels Nov 21, 2023
@julien-nc julien-nc added this to the Nextcloud 28 milestone Nov 21, 2023
@julien-nc julien-nc requested review from susnux, juliushaertl, skjnldsv, a team and emoral435 and removed request for a team November 21, 2023 10:05
@julien-nc julien-nc force-pushed the fix/relative-url-x-requested-with branch from 0e18a47 to 6b3e70c Compare November 21, 2023 10:09
@blizzz blizzz mentioned this pull request Nov 22, 2023
5 tasks
Copy link
Contributor

@emoral435 emoral435 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me!

@blizzz blizzz modified the milestones: Nextcloud 28, Nextcloud 29 Nov 23, 2023
@julien-nc julien-nc force-pushed the fix/relative-url-x-requested-with branch 2 times, most recently from aeac884 to 323b6f7 Compare November 24, 2023 09:19
@julien-nc
Copy link
Member Author

/backport to stable28

@julien-nc
Copy link
Member Author

@juliushaertl @emoral435 @susnux Cypress test failure seems unrelated (theming app). Can someone force merge this? 🙏

… URL is empty

Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
Signed-off-by: Julien Veyssier <julien-nc@posteo.net>
@susnux susnux force-pushed the fix/relative-url-x-requested-with branch from 8729f37 to 5d5572c Compare November 24, 2023 10:33
@julien-nc julien-nc merged commit d3fa954 into master Nov 24, 2023
41 checks passed
@julien-nc julien-nc deleted the fix/relative-url-x-requested-with branch November 24, 2023 11:50
@julien-nc
Copy link
Member Author

/backport to stable27

@julien-nc
Copy link
Member Author

/backport to stable26

@julien-nc
Copy link
Member Author

/backport to stable25

@skjnldsv
Copy link
Member

/skjnldsv-backport to stable27

@skjnldsv
Copy link
Member

/skjnldsv-backport to stable26

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3. to review Waiting for reviews bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants