Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add some header constants #8

Merged
merged 1 commit into from
Aug 21, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
add some header constants
  • Loading branch information
xmx authored Aug 19, 2022
commit 7496f2ed68e4f4dcee8705ba070e1978f9401bf9
98 changes: 66 additions & 32 deletions constant.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,64 @@ const (

// Headers
const (
HeaderAccept = "Accept"
HeaderAcceptedLanguage = "Accept-Language"
HeaderAcceptEncoding = "Accept-Encoding"
HeaderAllow = "Allow"
HeaderAuthorization = "Authorization"
HeaderConnection = "Connection"
HeaderContentDisposition = "Content-Disposition"
HeaderContentEncoding = "Content-Encoding"
HeaderContentLength = "Content-Length"
HeaderContentType = "Content-Type"
HeaderCookie = "Cookie"
HeaderSetCookie = "Set-Cookie"
HeaderIfModifiedSince = "If-Modified-Since"
HeaderLastModified = "Last-Modified"
HeaderEtag = "Etag"
HeaderLocation = "Location"
HeaderUpgrade = "Upgrade"
HeaderVary = "Vary"
HeaderWWWAuthenticate = "WWW-Authenticate"
HeaderXForwardedFor = "X-Forwarded-For"
HeaderAccept = "Accept" // RFC 7231, 5.3.2
HeaderAcceptCharset = "Accept-Charset" // RFC 7231, 5.3.3
HeaderAcceptEncoding = "Accept-Encoding" // RFC 7231, 5.3.4
HeaderAcceptLanguage = "Accept-Language" // RFC 7231, 5.3.5
HeaderAcceptPatch = "Accept-Patch" // RFC 5789, 3.1
HeaderAcceptRanges = "Accept-Ranges" // RFC 7233, 2.3
HeaderAge = "Age" // RFC 7234, 5.1
HeaderAllow = "Allow" // RFC 7231, 7.4.1
HeaderAuthorization = "Authorization" // RFC 7235, 4.2
HeaderCacheControl = "Cache-Control" // RFC 7234, 5.2
HeaderConnection = "Connection" // RFC 7230, 6.1
HeaderContentDisposition = "Content-Disposition" // RFC 6266
HeaderContentEncoding = "Content-Encoding" // RFC 7231, 3.1.2.2
HeaderContentLanguage = "Content-Language" // RFC 7231, 3.1.3.2
HeaderContentLength = "Content-Length" // RFC 7230, 3.3.2
HeaderContentLocation = "Content-Location" // RFC 7231, 3.1.4.2
HeaderContentRange = "Content-Range" // RFC 7233, 4.2
HeaderContentType = "Content-Type" // RFC 7231, 3.1.1.5
HeaderCookie = "Cookie" // RFC 2109, 4.3.4
HeaderDate = "Date" // RFC 7231, 7.1.1.2
HeaderETag = "ETag" // RFC 7232, 2.3
HeaderExpect = "Expect" // RFC 7231, 5.1.1
HeaderExpires = "Expires" // RFC 7234, 5.3
HeaderFrom = "From" // RFC 7231, 5.5.1
HeaderHost = "Host" // RFC 7230, 5.4
HeaderIfMatch = "If-Match" // RFC 7232, 3.1
HeaderIfModifiedSince = "If-Modified-Since" // RFC 7232, 3.3
HeaderIfNoneMatch = "If-None-Match" // RFC 7232, 3.2
HeaderIfRange = "If-Range" // RFC 7233, 3.2
HeaderIfUnmodifiedSince = "If-Unmodified-Since" // RFC 7232, 3.4
HeaderLastModified = "Last-Modified" // RFC 7232, 2.2
HeaderLink = "Link" // RFC 5988
HeaderLocation = "Location" // RFC 7231, 7.1.2
HeaderMaxForwards = "Max-Forwards" // RFC 7231, 5.1.2
HeaderOrigin = "Origin" // RFC 6454
HeaderPragma = "Pragma" // RFC 7234, 5.4
HeaderProxyAuthenticate = "Proxy-Authenticate" // RFC 7235, 4.3
HeaderProxyAuthorization = "Proxy-Authorization" // RFC 7235, 4.4
HeaderRange = "Range" // RFC 7233, 3.1
HeaderReferer = "Referer" // RFC 7231, 5.5.2
HeaderRetryAfter = "Retry-After" // RFC 7231, 7.1.3
HeaderServer = "Server" // RFC 7231, 7.4.2
HeaderSetCookie = "Set-Cookie" // RFC 2109, 4.2.2
HeaderSetCookie2 = "Set-Cookie2" // RFC 2965
HeaderTE = "TE" // RFC 7230, 4.3
HeaderTrailer = "Trailer" // RFC 7230, 4.4
HeaderTransferEncoding = "Transfer-Encoding" // RFC 7230, 3.3.1
HeaderUpgrade = "Upgrade" // RFC 7230, 6.7
HeaderUserAgent = "User-Agent" // RFC 7231, 5.5.3
HeaderVary = "Vary" // RFC 7231, 7.1.4
HeaderVia = "Via" // RFC 7230, 5.7.1
HeaderWarning = "Warning" // RFC 7234, 5.5
HeaderWWWAuthenticate = "WWW-Authenticate" // RFC 7235, 4.1
HeaderForwarded = "Forwarded" // RFC 7239
HeaderXForwardedBy = "X-Forwarded-By" // RFC 7239, 5.1
HeaderXForwardedFor = "X-Forwarded-For" // RFC 7239, 5.2
HeaderXForwardedHost = "X-Forwarded-Host" // RFC 7239, 5.3
HeaderXForwardedPort = "X-Forwarded-Port"
HeaderXForwardedProto = "X-Forwarded-Proto"
HeaderXForwardedProtocol = "X-Forwarded-Protocol"
HeaderXForwardedSSL = "X-Forwarded-Ssl"
Expand All @@ -73,20 +111,16 @@ const (
HeaderXServerID = "X-Server-Id"
HeaderXRequestID = "X-Request-Id"
HeaderXRequestedWith = "X-Requested-With"
HeaderServer = "Server"
HeaderOrigin = "Origin"
HeaderReferer = "Referer"
HeaderUserAgent = "User-Agent"

// Access control
HeaderAccessControlRequestMethod = "Access-Control-Request-Method"
HeaderAccessControlRequestHeaders = "Access-Control-Request-Headers"
HeaderAccessControlAllowOrigin = "Access-Control-Allow-Origin"
HeaderAccessControlAllowMethods = "Access-Control-Allow-Methods"
HeaderAccessControlAllowHeaders = "Access-Control-Allow-Headers"
HeaderAccessControlAllowCredentials = "Access-Control-Allow-Credentials"
HeaderAccessControlExposeHeaders = "Access-Control-Expose-Headers"
HeaderAccessControlMaxAge = "Access-Control-Max-Age"
HeaderAccessControlAllowCredentials = "Access-Control-Allow-Credentials" // https://www.w3.org/TR/cors/#http-access-control-allow-credentials
HeaderAccessControlAllowHeaders = "Access-Control-Allow-Headers" // https://www.w3.org/TR/cors/#http-access-control-allow-headers
HeaderAccessControlAllowMethods = "Access-Control-Allow-Methods" // https://www.w3.org/TR/cors/#http-access-control-allow-methods
HeaderAccessControlAllowOrigin = "Access-Control-Allow-Origin" // https://www.w3.org/TR/cors/#http-access-control-allow-origin
HeaderAccessControlExposeHeaders = "Access-Control-Expose-Headers" // https://www.w3.org/TR/cors/#http-access-control-expose-headers
HeaderAccessControlMaxAge = "Access-Control-Max-Age" // https://www.w3.org/TR/cors/#http-access-control-max-age
HeaderAccessControlRequestHeaders = "Access-Control-Request-Headers" // https://www.w3.org/TR/cors/#http-access-control-request-headers
HeaderAccessControlRequestMethod = "Access-Control-Request-Method" // https://www.w3.org/TR/cors/#http-access-control-request-method

// Security
HeaderStrictTransportSecurity = "Strict-Transport-Security"
Expand Down