Skip to content

app/: the React app's pages (sc-8900) - #83

Closed
ndbroadbent wants to merge 2 commits into
laravel-security-headersfrom
laravel-spa
Closed

ndbroadbent wants to merge 2 commits into
laravel-security-headersfrom
laravel-spa

Conversation

@ndbroadbent

Copy link
Copy Markdown
Member

Part of sc-8900. Stacked on #80, so the security policy's hashes and the page come from the same public/index.html.

Laravel already serves the files in public/ (the frontend's build goes there in the image) before routing. This adds the web group's fallback: any other page path gets public/index.html with cache-control: no-cache, so client-side routes such as /docspring/billing load.

As today's missing_files_are_not_found, these get a 404 instead of the page:

  • a path naming a file that isn't there (/logo.png); crawlers would take the HTML for the file, and Cloudflare caches by extension;
  • anything under /api/;
  • anything but GET or HEAD.

Tests: a unit test for telling file paths from pages, and an integration test covering a client route, a missing file, an API path and a POST. The whole app suite passes on docspring-dev, and clippy is clean.

… as they are, and any other page path on the web group gets public/index.html (no-cache), so client-side routes load; a path naming a missing file, anything under /api/, and anything but GET or HEAD get a 404, as today
@visualci-com

visualci-com Bot commented Dec 2, 2026 •

Copy link
Copy Markdown

VisualCI

docspring/visualci · build #338 · 331 unchanged · no changes

This PR vs base: nothing since #282, across 2 builds

Updated as builds change. Agents can review with VisualCI's MCP tools.

…dex.html come from the static file server), and /assets/ public, max-age=31536000, immutable; the fallback serves the page read at boot with the policy's hashes; only the app host serves the app's pages (any host when none are configured), so other hosts' unknown paths are a 404; the /api/ui 404 is tested as JSON
@ndbroadbent

Copy link
Copy Markdown
Member Author

Included in #87.

@ndbroadbent ndbroadbent closed this Dec 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant