mirror of
https://github.com/gin-gonic/gin.git
synced 2026-01-12 01:26:56 +08:00
feat: (doc) add Header Constants
This commit is contained in:
parent
43a4edf1a1
commit
85aae676c1
136
docs/doc.md
136
docs/doc.md
@ -34,6 +34,7 @@
|
||||
- [Bind HTML checkboxes](#bind-html-checkboxes)
|
||||
- [Multipart/Urlencoded binding](#multiparturlencoded-binding)
|
||||
- [XML, JSON, YAML, TOML and ProtoBuf rendering](#xml-json-yaml-toml-and-protobuf-rendering)
|
||||
- [Header Constants](#header-constants)
|
||||
- [SecureJSON](#securejson)
|
||||
- [JSONP](#jsonp)
|
||||
- [AsciiJSON](#asciijson)
|
||||
@ -2431,6 +2432,141 @@ func main() {
|
||||
}
|
||||
```
|
||||
|
||||
### header-constants
|
||||
|
||||
```go
|
||||
|
||||
const (
|
||||
HeaderAuthorization string = "Authorization"
|
||||
HeaderProxyAuthenticate string = "Proxy-Authenticate"
|
||||
HeaderProxyAuthorization string = "Proxy-Authorization"
|
||||
HeaderWWWAuthenticate string = "WWW-Authenticate"
|
||||
HeaderAge string = "Age"
|
||||
HeaderCacheControl string = "Cache-Control"
|
||||
HeaderClearSiteData string = "Clear-Site-Data"
|
||||
HeaderExpires string = "Expires"
|
||||
HeaderPragma string = "Pragma"
|
||||
HeaderWarning string = "Warning"
|
||||
HeaderAcceptCH string = "Accept-CH"
|
||||
HeaderAcceptCHLifetime string = "Accept-CH-Lifetime"
|
||||
HeaderContentDPR string = "Content-DPR"
|
||||
HeaderDPR string = "DPR"
|
||||
HeaderEarlyData string = "Early-Data"
|
||||
HeaderSaveData string = "Save-Data"
|
||||
HeaderViewportWidth string = "Viewport-Width"
|
||||
HeaderWidth string = "Width"
|
||||
HeaderETag string = "ETag"
|
||||
HeaderIfMatch string = "If-Match"
|
||||
HeaderIfModifiedSince string = "If-Modified-Since"
|
||||
HeaderIfNoneMatch string = "If-None-Match"
|
||||
HeaderIfUnmodifiedSince string = "If-Unmodified-Since"
|
||||
HeaderLastModified string = "Last-Modified"
|
||||
HeaderVary string = "Vary"
|
||||
HeaderConnection string = "Connection"
|
||||
HeaderKeepAlive string = "Keep-Alive"
|
||||
HeaderAccept string = "Accept"
|
||||
HeaderAcceptCharset string = "Accept-Charset"
|
||||
HeaderAcceptEncoding string = "Accept-Encoding"
|
||||
HeaderAcceptLanguage string = "Accept-Language"
|
||||
HeaderCookie string = "Cookie"
|
||||
HeaderExpect string = "Expect"
|
||||
HeaderMaxForwards string = "Max-Forwards"
|
||||
HeaderSetCookie string = "Set-Cookie"
|
||||
HeaderAccessControlAllowCredentials string = "Access-Control-Allow-Credentials"
|
||||
HeaderAccessControlAllowHeaders string = "Access-Control-Allow-Headers"
|
||||
HeaderAccessControlAllowMethods string = "Access-Control-Allow-Methods"
|
||||
HeaderAccessControlAllowOrigin string = "Access-Control-Allow-Origin"
|
||||
HeaderAccessControlExposeHeaders string = "Access-Control-Expose-Headers"
|
||||
HeaderAccessControlMaxAge string = "Access-Control-Max-Age"
|
||||
HeaderAccessControlRequestHeaders string = "Access-Control-Request-Headers"
|
||||
HeaderAccessControlRequestMethod string = "Access-Control-Request-Method"
|
||||
HeaderOrigin string = "Origin"
|
||||
HeaderTimingAllowOrigin string = "Timing-Allow-Origin"
|
||||
HeaderXPermittedCrossDomainPolicies string = "X-Permitted-Cross-Domain-Policies"
|
||||
HeaderDNT string = "DNT"
|
||||
HeaderTk string = "Tk"
|
||||
HeaderContentDisposition string = "Content-Disposition"
|
||||
HeaderContentEncoding string = "Content-Encoding"
|
||||
HeaderContentLanguage string = "Content-Language"
|
||||
HeaderContentLength string = "Content-Length"
|
||||
HeaderContentLocation string = "Content-Location"
|
||||
HeaderContentType string = "Content-Type"
|
||||
HeaderForwarded string = "Forwarded"
|
||||
HeaderVia string = "Via"
|
||||
HeaderXForwardedFor string = "X-Forwarded-For"
|
||||
HeaderXForwardedHost string = "X-Forwarded-Host"
|
||||
HeaderXForwardedProto string = "X-Forwarded-Proto"
|
||||
HeaderXForwardedProtocol string = "X-Forwarded-Protocol"
|
||||
HeaderXForwardedSsl string = "X-Forwarded-Ssl"
|
||||
HeaderXUrlScheme string = "X-Url-Scheme"
|
||||
HeaderRealIp string = "X-Real-IP"
|
||||
HeaderLocation string = "Location"
|
||||
HeaderFrom string = "From"
|
||||
HeaderHost string = "Host"
|
||||
HeaderReferer string = "Referer"
|
||||
HeaderReferrerPolicy string = "Referrer-Policy"
|
||||
HeaderUserAgent string = "User-Agent"
|
||||
HeaderAllow string = "Allow"
|
||||
HeaderServer string = "Server"
|
||||
HeaderAcceptRanges string = "Accept-Ranges"
|
||||
HeaderContentRange string = "Content-Range"
|
||||
HeaderIfRange string = "If-Range"
|
||||
HeaderRange string = "Range"
|
||||
HeaderContentSecurityPolicy string = "Content-Security-Policy"
|
||||
HeaderContentSecurityPolicyReportOnly string = "Content-Security-Policy-Report-Only"
|
||||
HeaderCrossOriginResourcePolicy string = "Cross-Origin-Resource-Policy"
|
||||
HeaderExpectCT string = "Expect-CT"
|
||||
HeaderFeaturePolicy string = "Feature-Policy"
|
||||
HeaderPublicKeyPins string = "Public-Key-Pins"
|
||||
HeaderPublicKeyPinsReportOnly string = "Public-Key-Pins-Report-Only"
|
||||
HeaderStrictTransportSecurity string = "Strict-Transport-Security"
|
||||
HeaderUpgradeInsecureRequests string = "Upgrade-Insecure-Requests"
|
||||
HeaderXContentTypeOptions string = "X-Content-Type-Options"
|
||||
HeaderXDownloadOptions string = "X-Download-Options"
|
||||
HeaderXFrameOptions string = "X-Frame-Options"
|
||||
HeaderXPoweredBy string = "X-Powered-By"
|
||||
HeaderXXSSProtection string = "X-XSS-Protection"
|
||||
HeaderLastEventID string = "Last-Event-ID"
|
||||
HeaderNEL string = "NEL"
|
||||
HeaderPingFrom string = "Ping-From"
|
||||
HeaderPingTo string = "Ping-To"
|
||||
HeaderReportTo string = "Report-To"
|
||||
HeaderTE string = "TE"
|
||||
HeaderTrailer string = "Trailer"
|
||||
HeaderTransferEncoding string = "Transfer-Encoding"
|
||||
HeaderSecWebSocketAccept string = "Sec-WebSocket-Accept"
|
||||
HeaderSecWebSocketExtensions string = "Sec-WebSocket-Extensions"
|
||||
HeaderSecWebSocketKey string = "Sec-WebSocket-Key"
|
||||
HeaderSecWebSocketProtocol string = "Sec-WebSocket-Protocol"
|
||||
HeaderSecWebSocketVersion string = "Sec-WebSocket-Version"
|
||||
HeaderAcceptPatch string = "Accept-Patch"
|
||||
HeaderAcceptPushPolicy string = "Accept-Push-Policy"
|
||||
HeaderAcceptSignature string = "Accept-Signature"
|
||||
HeaderAltSvc string = "Alt-Svc"
|
||||
HeaderDate string = "Date"
|
||||
HeaderIndex string = "Index"
|
||||
HeaderLargeAllocation string = "Large-Allocation"
|
||||
HeaderLink string = "Link"
|
||||
HeaderPushPolicy string = "Push-Policy"
|
||||
HeaderRetryAfter string = "Retry-After"
|
||||
HeaderServerTiming string = "Server-Timing"
|
||||
HeaderSignature string = "Signature"
|
||||
HeaderSignedHeaders string = "Signed-Headers"
|
||||
HeaderSourceMap string = "SourceMap"
|
||||
HeaderUpgrade string = "Upgrade"
|
||||
HeaderXDNSPrefetchControl string = "X-DNS-Prefetch-Control"
|
||||
HeaderXPingback string = "X-Pingback"
|
||||
HeaderXRequestID string = "X-Request-ID"
|
||||
HeaderXRequestedWith string = "X-Requested-With"
|
||||
HeaderXRobotsTag string = "X-Robots-Tag"
|
||||
HeaderXUACompatible string = "X-UA-Compatible"
|
||||
)
|
||||
|
||||
```
|
||||
|
||||
|
||||
|
||||
|
||||
## Don't trust all proxies
|
||||
|
||||
Gin lets you specify which headers to hold the real client IP (if any),
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user