Serve share links through an interstitial page #7
Loading…
Reference in a new issue
No description provided.
Delete branch "d/share-interstitial"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
The share token URL now shows a small page with the file one click deeper, so link-preview crawlers in chat apps fetch a harmless stub instead of the document. Adds noindex and no-referrer headers on both share endpoints.
🤖 Claude AI Code Review
Summary
Splits the share endpoint into an interstitial HTML page plus a deeper file endpoint, adding noindex/no-referrer headers to keep link-preview crawlers away from documents.
Code Quality ⭐⭐⭐⭐☆
Clean refactor extracting shared validation logic; title is properly HTML-encoded.
Issues
🟡 Program.cs —
shareTokeninterpolated intohrefwithout URL-encoding. The token comes from the route so it's typically already URL-safe, but if a token could contain characters like"or>it would break out of the attribute. SincesafeTitleis HTML-encoded butshareTokenis not, useUri.EscapeDataString(shareToken)in thehrefto be safe and consistent.🟢 Program.cs — the interstitial does a
GetDocumentAsynccall the old flow didn't, doubling the round-trips to Paperless for a share view (interstitial + file). Acceptable, just noting the added cost.The token-in-href concern is worth addressing but low-risk given the token format is HMAC/base64url-style. Not a blocker.
📊 Tokens: 3725 input + 409 output | 💰 Cost: ~$0.0289
Generated by Claude Opus 4.8 via Gitea Actions