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

Remove v3 relic of 404s being a lie because of react router #770

Merged
merged 1 commit into from
Jul 15, 2023

Conversation

mathcolo
Copy link
Contributor

Motivation

V3 relied on React Router to handle different URLs, and that worked because S3 returned the SPA for any request path. Next is more of a good citizen, in that it's generating actual files that are being served by S3/CloudFront. For that reason, we want the status code for 404s to ACTUALLY BE 404! :) Finally!

Changes

We're changing the 404 ResponseCode from 200 to 404. https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-cloudfront-distribution-customerrorresponse.html

Testing Instructions

Previous behavior:

prestonmueller@Preston14 ~ $ curl -sI https://dashboard-beta.labs.transitmatters.org/this_doesnt_exist | head -n 1
HTTP/1.1 200 OK

Behavior after this is merged (anticipated);

prestonmueller@Preston14 ~ $ curl -sI https://dashboard-beta.labs.transitmatters.org/this_doesnt_exist | head -n 1
HTTP/1.1 404

@mathcolo mathcolo self-assigned this Jul 15, 2023
@github-actions github-actions bot added the backend Change to backend code label Jul 15, 2023
@mathcolo mathcolo merged commit 0fb57ee into dashboard-v4 Jul 15, 2023
5 checks passed
@mathcolo mathcolo deleted the v4/use_404_error_code_for_404 branch July 15, 2023 18:32
@devinmatte devinmatte added the v4 label Jul 15, 2023
@devinmatte devinmatte added this to the Dashboard V4 milestone Jul 15, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backend Change to backend code
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

2 participants