cds-snc / platform-forms-client

NextJS application that serves the public-facing website for Forms
https://forms-staging.cdssandbox.xyz/
MIT License
34 stars 13 forks source link

fix: Add file extention check into single middleware matcher. #3870

Closed bryan-robitaille closed 3 months ago

bryan-robitaille commented 3 months ago

Summary | Résumé

The current middleware was behaving unexpectedly with the current matcher array. The documentation was not clear that the array represents a logical OR between matchers and not a logical AND. The matchers were originally seperated for readability but have now been combined to ensure proper functionality.

Discovered because favicon.ico was having a language parameter added to it's path by the middleware which in turn caused the browser to receive a 404 when requesting the redirected path.

Screenshot 2024-06-20 at 12 18 19 PM Screenshot 2024-06-20 at 12 18 05 PM

Test instructions | Instructions pour tester la modification

Pull Request Checklist

Please complete the following items in the checklist before you request a review:

github-actions[bot] commented 3 months ago

:test_tube: Review environment

https://ik5jqrtfukzl7qhm4t34cqosay0szjpw.lambda-url.ca-central-1.on.aws/