Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContentDispositionHeader ¶
func ContentDispositionHeader(name string, mode DispositionMode) (string, error)
ContentDispositionHeader builds an RFC 6266 Content-Disposition value. Uses the ext-value (filename*) form for non-ASCII characters. Expects name to have already passed SanitizeDisplayName.
func Digest ¶
Digest returns the SHA-256 of a token. Only digests hit disk; raw tokens stay in memory.
func EqualDigest ¶
EqualDigest compares two digests in constant time.
func NewToken ¶
func NewToken() string
NewToken returns a 128-bit token encoded as 26 lowercase base32 chars.
func SanitizeDisplayName ¶
SanitizeDisplayName validates a user-supplied display name for use in URL path and Content-Disposition. Rejects anything that could enable path traversal, header injection, or Windows-reserved devices.
Types ¶
Click to show internal directories.
Click to hide internal directories.