-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathheaders.go
95 lines (90 loc) · 3.9 KB
/
headers.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
package headers
import (
"net/textproto"
)
// Version is this package's version
const Version = "2.1.0"
// HTTP headers
const (
Accept = "Accept"
AcceptCharset = "Accept-Charset"
AcceptEncoding = "Accept-Encoding"
AcceptLanguage = "Accept-Language"
Authorization = "Authorization"
CacheControl = "Cache-Control"
ContentLength = "Content-Length"
ContentMD5 = "Content-MD5"
ContentType = "Content-Type"
DoNotTrack = "DNT"
IfMatch = "If-Match"
IfModifiedSince = "If-Modified-Since"
IfNoneMatch = "If-None-Match"
IfRange = "If-Range"
IfUnmodifiedSince = "If-Unmodified-Since"
MaxForwards = "Max-Forwards"
ProxyAuthorization = "Proxy-Authorization"
Pragma = "Pragma"
Range = "Range"
Referer = "Referer"
UserAgent = "User-Agent"
TE = "TE"
Via = "Via"
Warning = "Warning"
Cookie = "Cookie"
Origin = "Origin"
AcceptDatetime = "Accept-Datetime"
XRequestedWith = "X-Requested-With"
AccessControlAllowOrigin = "Access-Control-Allow-Origin"
AccessControlAllowMethods = "Access-Control-Allow-Methods"
AccessControlAllowHeaders = "Access-Control-Allow-Headers"
AccessControlAllowCredentials = "Access-Control-Allow-Credentials"
AccessControlExposeHeaders = "Access-Control-Expose-Headers"
AccessControlMaxAge = "Access-Control-Max-Age"
AccessControlRequestMethod = "Access-Control-Request-Method"
AccessControlRequestHeaders = "Access-Control-Request-Headers"
AcceptPatch = "Accept-Patch"
AcceptRanges = "Accept-Ranges"
Allow = "Allow"
ContentEncoding = "Content-Encoding"
ContentLanguage = "Content-Language"
ContentLocation = "Content-Location"
ContentDisposition = "Content-Disposition"
ContentRange = "Content-Range"
ETag = "ETag"
Expires = "Expires"
LastModified = "Last-Modified"
Link = "Link"
Location = "Location"
P3P = "P3P"
ProxyAuthenticate = "Proxy-Authenticate"
Refresh = "Refresh"
RetryAfter = "Retry-After"
Server = "Server"
SetCookie = "Set-Cookie"
StrictTransportSecurity = "Strict-Transport-Security"
TransferEncoding = "Transfer-Encoding"
Upgrade = "Upgrade"
Vary = "Vary"
WWWAuthenticate = "WWW-Authenticate"
// Non-Standard
XFrameOptions = "X-Frame-Options"
XXSSProtection = "X-XSS-Protection"
ContentSecurityPolicy = "Content-Security-Policy"
XContentSecurityPolicy = "X-Content-Security-Policy"
XWebKitCSP = "X-WebKit-CSP"
XContentTypeOptions = "X-Content-Type-Options"
XPoweredBy = "X-Powered-By"
XUACompatible = "X-UA-Compatible"
XForwardedProto = "X-Forwarded-Proto"
XHTTPMethodOverride = "X-HTTP-Method-Override"
XForwardedFor = "X-Forwarded-For"
XRealIP = "X-Real-IP"
XCSRFToken = "X-CSRF-Token"
XRatelimitLimit = "X-Ratelimit-Limit"
XRatelimitRemaining = "X-Ratelimit-Remaining"
XRatelimitReset = "X-Ratelimit-Reset"
)
// Normalize formats the input header to the formation of "Xxx-Xxx".
func Normalize(header string) string {
return textproto.CanonicalMIMEHeaderKey(header)
}