Change encrypted URL format to /v1/e/{token}/img.{ext}

Add trailing filename to encrypted URLs for better browser compatibility.
The filename is ignored by the server but helps browsers identify content type.
This commit is contained in:
2026-01-08 16:14:01 -08:00
parent 6ab0d4a5b9
commit 87a8393537
3 changed files with 11 additions and 3 deletions

View File

@@ -154,8 +154,14 @@ func (s *Handlers) HandleGenerateURL() http.HandlerFunc {
scheme = "http"
}
// Determine file extension for the trailing filename
ext := format
if ext == "" || ext == "orig" {
ext = "jpg" // Default extension
}
host := r.Host
generatedURL := scheme + "://" + host + "/v1/e/" + url.PathEscape(token)
generatedURL := scheme + "://" + host + "/v1/e/" + url.PathEscape(token) + "/img." + ext
// Format expiry for display
expiresAtStr := "Never"