Skip to content

Commit

Permalink
add headers
Browse files Browse the repository at this point in the history
  • Loading branch information
DavidCai1111 committed Nov 16, 2016
1 parent 6498460 commit 67c910f
Show file tree
Hide file tree
Showing 2 changed files with 110 additions and 1 deletion.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,31 @@
# headers
# headers

HTTP header constants for Gophers.

## Installation

```sh
go get -u github.com/go-http-utils/headers
```

## Documentation

https://godoc.org/github.com/go-http-utils/headers

## Usage

```go
impost (
"fmt"

"github.com/DavidCai1993/headers"
)

fmt.Println(headers.HeaderAcceptCharset)
// -> "Accept-Charset"

fmt.Println(headers.HeaderIfNoneMatch)
// -> "If-None-Match"

// ...
```
79 changes: 79 additions & 0 deletions headers.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
package headers

// HTTP headers
const (
HeaderAccept = "Accept"
HeaderAcceptCharset = "Accept-Charset"
HeaderAcceptEncoding = "Accept-Encoding"
HeaderAcceptLanguage = "Accept-Language"
HeaderAuthorization = "Authorization"
HeaderCacheControl = "Cache-Control"
HeaderContentLength = "Content-Length"
HeaderContentMD5 = "Content-MD5"
HeaderContentType = "Content-Type"
HeaderIfMatch = "If-Match"
HeaderIfModifiedSince = "If-Modified-Since"
HeaderIfNoneMatch = "If-None-Match"
HeaderIfRange = "If-Range"
HeaderIfUnmodifiedSince = "If-Unmodified-Since"
HeaderMaxForwards = "Max-Forwards"
HeaderProxyAuthorization = "Proxy-Authorization"
HeaderPragma = "Pragma"
HeaderRange = "Range"
HeaderReferer = "Referer"
HeaderUserAgent = "User-Agent"
HeaderTE = "TE"
HeaderVia = "Via"
HeaderWarning = "Warning"
HeaderCookie = "Cookie"
HeaderOrigin = "Origin"
HeaderAcceptDatetime = "Accept-Datetime"
HeaderXRequestedWith = "X-Requested-With"
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"
HeaderAccessControlRequestMethod = "Access-Control-Request-Method"
HeaderAccessControlRequestHeaders = "Access-Control-Request-Headers"
HeaderAcceptPatch = "Accept-Patch"
HeaderAcceptRanges = "Accept-Ranges"
HeaderAllow = "Allow"
HeaderContentEncoding = "Content-Encoding"
HeaderContentLanguage = "Content-Language"
HeaderContentLocation = "Content-Location"
HeaderContentDisposition = "Content-Disposition"
HeaderContentRange = "Content-Range"
HeaderETag = "ETag"
HeaderExpires = "Expires"
HeaderLastModified = "Last-Modified"
HeaderLink = "Link"
HeaderLocation = "Location"
HeaderP3P = "P3P"
HeaderProxyAuthenticate = "Proxy-Authenticate"
HeaderRefresh = "Refresh"
HeaderRetryAfter = "Retry-After"
HeaderServer = "Server"
HeaderSetCookie = "Set-Cookie"
HeaderStrictTransportSecurity = "Strict-Transport-Security"
HeaderTransferEncoding = "Transfer-Encoding"
HeaderUpgrade = "Upgrade"
HeaderVary = "Vary"
HeaderWWWAuthenticate = "WWW-Authenticate"

// Non-Standard
HeaderXFrameOptions = "X-Frame-Options"
HeaderXXSSProtection = "X-XSS-Protection"
HeaderContentSecurityPolicy = "Content-Security-Policy"
HeaderXContentSecurityPolicy = "X-Content-Security-Policy"
HeaderXWebKitCSP = "X-WebKit-CSP"
HeaderXContentTypeOptions = "X-Content-Type-Options"
HeaderXPoweredBy = "X-Powered-By"
HeaderXUACompatible = "X-UA-Compatible"
HeaderXForwardedProto = "X-Forwarded-Proto"
HeaderXHTTPMethodOverride = "X-HTTP-Method-Override"
HeaderXForwardedFor = "X-Forwarded-For"
HeaderXRealIP = "X-Real-IP"
HeaderXCSRFToken = "X-CSRF-Token"
)

0 comments on commit 67c910f

Please sign in to comment.