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

Run CanonicalURLMiddleware in dev / test. #11167

Closed
2 tasks done
wilr opened this issue Mar 4, 2024 · 2 comments
Closed
2 tasks done

Run CanonicalURLMiddleware in dev / test. #11167

wilr opened this issue Mar 4, 2024 · 2 comments
Assignees

Comments

@wilr
Copy link
Member

wilr commented Mar 4, 2024

Module version(s) affected

5.0.0

Description

Currently CanonicalURLMiddleware only runs in production, this leads to the classic example of 'It works on mine(tm)' but more dangerously 'It works on the test site (tm)'. Out of the box, we should have as close to production behaviour as possible.

How to reproduce

Various ways to reproduce. The issue that hit this client was a fetch call fetch('api/endpoint') on UAT this successfully returns the response of api/endpoint controller. In production the response is a 301 redirect to 'api/endpoint/'.

Possible Solution

The PR changes CanonicalURLMiddleware to run by default in all environments. Specific rules can still be modified via YAML configuration.

Additional Context

No response

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)

PRs

@wilr
Copy link
Member Author

wilr commented Mar 4, 2024

#11154

@GuySartorelli
Copy link
Member

PRs have been merged

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants