Essentially, I'd like golang.org/x/net or net/http to expose functions to parse an HTTP comma-separated list header.
e.g Cache-Control and WWW-Authenticate
Note:
Content-Type and Content-Disposition can be parsed using mime
Currently, most of the go developers use alternatives like the archived gddo/httputil/header/.
// ParseList parses a comma separated list of values. Commas are ignored in// quoted strings. Quoted values are not unescaped or unquoted. Whitespace is// trimmed.funcParseList(headerstring) []string {}
// ParsePairs extracts key/value pairs from a comma-separated list of// values as described by RFC 2068 and returns a map[key]valuefuncParsePairs(headerstring) map[string]string {}
shaj13
changed the title
proposal: Export function to parse http comma separated list header
proposal: x/net: net/http: Export function to parse http comma separated list header
Feb 19, 2021
What did you expect to see?
Essentially, I'd like golang.org/x/net or net/http to expose functions to parse an HTTP comma-separated list header.
e.g
Cache-Control
andWWW-Authenticate
Note:
Content-Type and Content-Disposition can be parsed using mime
Currently, most of the go developers use alternatives like the archived gddo/httputil/header/.
net/http already expose ParseTime that exist in gddo/httputil/header/.
So I'd like to copy the underlying gddo/httputil/header/ implementation into x/net/http/httpguts
and change the method signatures to be as net/http ParseTime.
Example:
https://play.golang.org/p/LrsYjRqUJzP
The text was updated successfully, but these errors were encountered: