Repository navigation
fix(web): prevent legal URLs from rendering as tracks in SSR - #14753
Conversation
|
|
Dependency limit exceeded — report not shown. This pull request scan exceeded the 10,000-dependency limit applied to this scan, so the results are incomplete and may be inaccurate. To avoid reporting false positives, Socket has not posted a report. Upgrade your plan to raise the dependency limit and get complete reports, or view the partial scan in the dashboard. Socket is always free for open source. If this is a non-commercial open source project, contact us to request a free Team account. |
Facebook's crawler receives HTTP 500 for
/legal/privacy-policyeven after passing the Cloudflare WAF. The SSR router interprets it as a track with handlelegaland slugprivacy-policy; the renderer then destructures an undefined track. Production Worker logs confirmed this failure.Reserve the
legalnamespace from music routes and add explicit SSR handling for all five existing legal pages. Each response includes page-specific metadata, a heading, a direct link to the existing PDF, and an embedded PDF without requiring JavaScript. Client rendering uses the existing public site. The policy documents themselves remain the source of truth; this change does not transcribe or alter their contents.Validation:
npm run test:ssr -w @audius/web: 7 regression tests pass, covering legal routes with trailing slashes, namespace exclusions, document rendering/assets, and ordinary music routes.facebookexternalhit/1.1and?fbclid=test; verified titles, PDF links, and embeds.git diff --checkpass.6057909f8d: full web tests, typecheck, lint/stylelint, production build, and SSR production build.After deployment, re-scrape the privacy-policy URL in Meta's Sharing Debugger and retry the required-action submission. Production and Meta settings have not been changed by this PR.