modulepackage
0.0.0-20210318114139-bca4b5702463
Repository: https://github.com/tj/go-headers.git
Documentation: pkg.go.dev
# README
Header
Header format parser to match Netlify's format.
Example
/*
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
## A path:
/templates/index.html
# Headers for that path:
X-Frame-Options: DENY
X-XSS-Protection: 1; mode=block
/templates/index2.html
X-Frame-Options: SAMEORIGIN
yields
{
"/*": {
"X-Frame-Options": [
"DENY"
],
"X-Xss-Protection": [
"1; mode=block"
]
},
"/templates/index.html": {
"X-Frame-Options": [
"DENY"
],
"X-Xss-Protection": [
"1; mode=block"
]
},
"/templates/index2.html": {
"X-Frame-Options": [
"SAMEORIGIN"
]
}
}
# Functions
Must parse utility.
Parse the given reader.
ParseString parses the given string.