Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Parse ¶
func Parse(ctype string) (mtype string, params map[string]string, invalidParams []string, err error)
Parse is a more tolerant implementation of Go's mime.ParseMediaType function.
Tolerances accounted for:
- Missing ';' between content-type and media parameters
- Repeating media parameters
- Unquoted values in media parameters containing 'tspecials' characters
- Newline characters
func ParseWithOptions ¶
func ParseWithOptions(ctype string, options ParseOptions) (mtype string, params map[string]string, invalidParams []string, err error)
ParseWithOptions parses media-type with additional options controlling the parsing behavior.
Types ¶
type ParseOptions ¶
type ParseOptions struct {
StripMediaTypeInvalidCharacters bool
}
ParseOptions controls the parsing of content-type and media-type strings.
Click to show internal directories.
Click to hide internal directories.