Reputation: 7396
It looks like when Google Cloud Storage serves the desired object for a NotFoundPage
, it includes the status code 404
.
Is there any way to set it so that the content is served with a 200
status? This will make it easier for any single page applications I deploy to the bucket to manage their own deep linking.
Upvotes: 2
Views: 912
Reputation: 545
I managed to fix the status code on a Flutter SPA by using the Load Balancer's Advanced Routing Rules:
website.com/products/12345/my-amazing-product
then I would enter:defaultService: projects/{..your-project-name..}/global/backendBuckets/{..your-backend-name..}
name: products
routeRules:
- matchRules:
- pathTemplateMatch: /products/*/*
priority: 10
service: projects/{..your-project-name..}/global/backendBuckets/{..your-backend-name..}
routeAction:
urlRewrite:
pathTemplateRewrite: /index.html
Thanks @Alexander Trauzzi for linking the Google issue - comment #48 there gave me the idea to try the advanced routing.
Upvotes: 1
Reputation: 7396
It appears as though this is currently a feature request over at the Google Cloud issue tracker: https://issuetracker.google.com/issues/151212194
I encourage anyone who arrives here to head over there and star the issue and also comment to help get this some priority.
Upvotes: 3