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

[5.1] SEF: Don't redirect for documents other than HTML #43083

Merged
merged 3 commits into from
Mar 18, 2024

Conversation

Hackwar
Copy link
Member

@Hackwar Hackwar commented Mar 18, 2024

Summary of Changes

With the new options to improve the routing, we introduced redirects when the URL does not meet our expectations. These redirects only take effect when the request is for a frontend page and when it is a GET request. However this also means that for example AJAX calls or calls to JSON/XML output gets redirected. This isn't an issue because GET requests do automatically follow redirects, but it would mean that such a request would be received, redirected and then received again, thus creating 2 requests on the server. In order to reduce load, this PR thus excludes all requests which aren't for HTML documents.

Testing Instructions

  1. Set the SEF plugin to remove a trailing slash
  2. Go to a category view in the frontend and add /?format=feed to the URL

Actual result BEFORE applying this Pull Request

You get redirected to the URL without the trailing slash and then receive the feed.

Expected result AFTER applying this Pull Request

You get the feed output directly without a redirect.

Link to documentations

Please select:

  • Documentation link for docs.joomla.org:

  • No documentation changes for docs.joomla.org needed

  • Pull Request link for manual.joomla.org:

  • No documentation changes for manual.joomla.org needed

@Fedik
Copy link
Member

Fedik commented Mar 18, 2024

I have tested this item ✅ successfully on bc8d43c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43083.

1 similar comment
@SniperSister
Copy link
Contributor

I have tested this item ✅ successfully on bc8d43c


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43083.

@alikon
Copy link
Contributor

alikon commented Mar 18, 2024

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/43083.

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Mar 18, 2024
@LadySolveig LadySolveig merged commit b10ac09 into joomla:5.1-dev Mar 18, 2024
3 checks passed
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Mar 18, 2024
@Quy Quy added this to the Joomla! 5.1.0 milestone Mar 18, 2024
@LadySolveig
Copy link
Contributor

Thank you @Hackwar 🚀 and also for testing @Fedik @SniperSister

@Hackwar Hackwar deleted the 5.1-router-exclude branch March 22, 2024 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants