- Replace the pastes table with a masonry card grid: each card shows the
paste's first image as a thumbnail, a short plain-text summary, meta badges,
and Copy link / Edit / QR / Delete actions.
- Clicking anywhere on a card (except the action buttons) opens an in-page
preview modal with the rendered paste in an iframe; it can be expanded to the
main content area or closed (Esc/backdrop/button). Keyboard accessible.
- Generate and cache 512px (long side) JPEG thumbnails for uploaded images on
first request (GET /uploads/thumb/{filename}); also generated at upload time
and invalidated on resize/delete. WebP falls back to the original.
- Sync the public paste pages (bin_view, bin_token) to the dark theme so they
match the rest of the app and the preview iframe.
- Relax framing headers to same-origin (X-Frame-Options SAMEORIGIN,
frame-ancestors 'self') so the same-origin preview iframe can load; cross-site
framing stays blocked.
- Document the new thumbnail route in the README routes table.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
The upload handlers called verifyCSRF (which reads a form value, implicitly
triggering ParseMultipartForm) before parsing the multipart body. When a file
exceeded the MaxBytesReader cap, the parse failed, FormValue returned "", and
the request was rejected as "Invalid CSRF token" (403) instead of a proper
413 "File too large". Small images parsed fine, so only large uploads broke.
- handlers.go: parse the multipart form explicitly before the CSRF check in
both handleUpload and handleFileUpload; report oversized bodies as 413 via
errors.As(http.MaxBytesError) instead of a fragile error-string compare.
- upload.js: offer in-browser canvas compression (downscale + JPEG re-encode)
for images over 10 MB before upload; falls back to the original on failure.
- server.go: allow blob: in CSP img-src so the compressor canvas can load the
selected file.
Co-Authored-By: Claude Opus 4.8 <[email protected]>
Adds a new POST /admin/upload-file endpoint for uploading any file type
alongside the existing image upload. Files are served with
Content-Disposition: attachment to prevent same-origin XSS via uploaded
HTML/SVG/JS. The display filename embedded in markdown link responses is
sanitized to block markdown injection.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
The JS QR library (qr.min.js) produced unscannable codes. Replaced with
a /admin/qr/{slug} endpoint using the same server-side rsc.io/qr that
already works on the home page.
Co-Authored-By: Claude Opus 4.6 <[email protected]>
Rebrand from "urlshort" to "Glimmer" across the entire codebase:
Go module/imports, build targets, HTML templates, deploy scripts
(including renaming service files), config, and README.
Co-Authored-By: Claude Opus 4.6 <[email protected]>