MCPcopy Create free account

hub / github.com/gorilla/handlers / functions

Functions125 in github.com/gorilla/handlers

↓ 43 callersMethodServeHTTP
(w http.ResponseWriter, r *http.Request)
cors.go:50
↓ 42 callersFunctionnewRequest
(method, url string)
handlers_test.go:29
↓ 21 callersFunctionCORS
CORS provides Cross-Origin Resource Sharing middleware. Example: import ( "net/http" "github.com/gorilla/handlers" "github.com/goril
cors.go:157
↓ 20 callersMethodHeader
()
compress_test.go:273
↓ 11 callersMethodWriteHeader
(s int)
handlers.go:60
↓ 7 callersMethodisMatch
(needle string, haystack []string)
cors.go:344
↓ 5 callersFunctionCanonicalHost
CanonicalHost is HTTP middleware that re-directs requests to the canonical domain. It accepts a domain and a status code (e.g. 301 or 302) and re-dire
canonical.go:29
↓ 5 callersFunctionCompressHandler
CompressHandler gzip compresses HTTP responses for clients that support it via the 'Accept-Encoding' header. Compressing TLS traffic may leak the pag
compress.go:63
↓ 5 callersMethodStatus
()
handlers.go:65
↓ 4 callersMethodPrintln
(...interface{})
recovery.go:11
↓ 4 callersMethodWrite
(b []byte)
handlers.go:54
↓ 4 callersFunctioncompressedRequest
(w *httptest.ResponseRecorder, compression string)
compress_test.go:25
↓ 4 callersFunctionconstructTypicalRequestOk
A typical request with an OK response.
logging_test.go:350
↓ 3 callersFunctionAllowedOrigins
AllowedOrigins sets the allowed origins for CORS requests, as used in the 'Allow-Access-Control-Origin' HTTP header. Note: Passing in a []string{"*"}
cors.go:232
↓ 3 callersMethodFlush
()
compress.go:44
↓ 3 callersFunctionRecoveryHandler
RecoveryHandler is HTTP middleware that recovers from a panic, logs the panic, writes http.StatusInternalServerError, and continues to the next handle
recovery.go:45
↓ 3 callersMethodServeHTTP
(w http.ResponseWriter, req *http.Request)
handlers.go:28
↓ 3 callersMethodSize
()
handlers.go:69
↓ 3 callersFunctionappendQuoted
(buf []byte, s string)
logging.go:80
↓ 2 callersFunctionAllowedMethods
AllowedMethods can be used to explicitly allow methods in the Access-Control-Allow-Methods header. This is a replacement operation so you must also pa
cors.go:211
↓ 2 callersFunctionAllowedOriginValidator
AllowedOriginValidator sets a function for evaluating allowed origins in CORS requests, represented by the 'Allow-Access-Control-Origin' HTTP header.
cors.go:248
↓ 2 callersFunctionLoggingHandler
LoggingHandler return a http.Handler that wraps h and logs requests to out in Apache Common Log Format (CLF). See http://httpd.apache.org/docs/2.2/lo
logging.go:238
↓ 2 callersFunctionLoggingScenario1
(t *testing.T, formatter LogFormatter, expected string)
logging_test.go:216
↓ 2 callersFunctionLoggingScenario2
(t *testing.T, formatter LogFormatter, expected string)
logging_test.go:243
↓ 2 callersFunctionLoggingScenario3
(t *testing.T, formatter LogFormatter, expected string)
logging_test.go:269
↓ 2 callersFunctionPrintRecoveryStack
PrintRecoveryStack is a functional option to enable or disable printing stack traces on panic.
recovery.go:64
↓ 2 callersFunctionRecoveryLogger
RecoveryLogger is a functional option to override the default logger.
recovery.go:54
↓ 2 callersFunctionbuildCommonLogLine
buildCommonLogLine builds a log entry for req in Apache Common Log Format. ts is the timestamp with which the entry should be logged. status and size
logging.go:147
↓ 2 callersFunctioncleanHost
cleanHost cleans invalid Host headers by stripping anything after '/' or ' '. This is backported from Go 1.5 (in response to issue #11206) and attempt
canonical.go:68
↓ 2 callersFunctiongetIP
getIP retrieves the IP from the X-Forwarded-For, X-Real-IP and RFC7239 Forwarded headers (in that order).
proxy_headers.go:67
↓ 2 callersFunctiongetScheme
getScheme retrieves the scheme from the X-Forwarded-Proto and RFC7239 Forwarded headers (in that order).
proxy_headers.go:101
↓ 2 callersFunctionmakeLogger
(w http.ResponseWriter)
logging.go:66
↓ 1 callersFunctionAllowCredentials
AllowCredentials can be used to specify that the user agent may pass authentication details along with the request.
cors.go:315
↓ 1 callersFunctionAllowedHeaders
Functional options for configuring CORS. AllowedHeaders adds the provided headers to the list of allowed headers in a CORS request. This is an appen
cors.go:190
↓ 1 callersFunctionCompressHandlerLevel
CompressHandlerLevel gzip compresses HTTP responses with specified compression level for clients that support it via the 'Accept-Encoding' header. Th
compress.go:73
↓ 1 callersFunctionContentTypeHandler
ContentTypeHandler wraps and returns a http.Handler, validating the request content type is compatible with the contentTypes list. It writes a HTTP 41
handlers.go:98
↓ 1 callersFunctionExposedHeaders
ExposedHeaders can be used to specify headers that are available and will not be stripped out by the user-agent.
cors.go:270
↓ 1 callersFunctionHTTPMethodOverrideHandler
HTTPMethodOverrideHandler wraps and returns a http.Handler which checks for the X-HTTP-Method-Override header or the _method form key, and overrides (
handlers.go:137
↓ 1 callersFunctionIgnoreOptions
IgnoreOptions causes the CORS middleware to ignore OPTIONS requests, instead passing them through to the next handler. This is useful when your applic
cors.go:306
↓ 1 callersFunctionLoggingScenario4
(t *testing.T, formatter LogFormatter, expected string)
logging_test.go:296
↓ 1 callersFunctionLoggingScenario5
(t *testing.T, formatter LogFormatter, expected string)
logging_test.go:322
↓ 1 callersFunctionMaxAge
MaxAge determines the maximum age (in seconds) between preflight requests. A maximum of 10 minutes is allowed. An age above this value will default to
cors.go:291
↓ 1 callersFunctionOptionStatusCode
OptionStatusCode sets a custom status code on the OPTIONS requests. Default behaviour sets it to 200 to reflect best practices. This is option is not
cors.go:261
↓ 1 callersFunctionProxyHeaders
ProxyHeaders inspects common reverse proxy headers and sets the corresponding fields in the HTTP request struct. These are X-Forwarded-For and X-Real-
proxy_headers.go:43
↓ 1 callersFunctionconstructConnectRequest
CONNECT request over http/2.0.
logging_test.go:363
↓ 1 callersFunctionconstructEncodedRequest
()
logging_test.go:383
↓ 1 callersFunctionisContentType
isContentType validates the Content-Type header matches the supplied contentType. That is, its type and subtype match.
handlers.go:85
↓ 1 callersMethodisOriginAllowed
(origin string)
cors.go:322
↓ 1 callersMethodlog
(v ...interface{})
recovery.go:83
↓ 1 callersFunctionparseCORSOptions
(opts ...CORSOption)
cors.go:165
↓ 1 callersFunctionparseRecoveryOptions
(h http.Handler, opts ...RecoveryOption)
recovery.go:25
↓ 1 callersFunctionwriteLog
writeLog writes a log entry for req to w in Apache Common Log Format. ts is the timestamp with which the entry should be logged. status and size are u
logging.go:194
FunctionBenchmarkWriteLog
(b *testing.B)
logging_test.go:132
FunctionCombinedLoggingHandler
CombinedLoggingHandler return a http.Handler that wraps h and logs requests to out in Apache Combined Log Format. See http://httpd.apache.org/docs/2.
logging.go:219
FunctionCustomLoggingHandler
CustomLoggingHandler provides a way to supply a custom log formatter while taking advantage of the mechanisms in this package.
logging.go:244
MethodFlush
Flush implements the http.Flusher interface.
compress_test.go:235
MethodFlush
()
compress.go:47
MethodHeader
Header/Write/WriteHeader implement the http.ResponseWriter interface.
compress_test.go:225
MethodHijack
Hijack implements the http.Hijacker interface.
compress_test.go:238
MethodHijack
()
handlers.go:73
MethodReadFrom
(r io.Reader)
compress.go:39
MethodServeHTTP
(w http.ResponseWriter, req *http.Request)
recovery.go:72
MethodServeHTTP
(w http.ResponseWriter, req *http.Request)
logging.go:42
MethodServeHTTP
(w http.ResponseWriter, r *http.Request)
canonical.go:37
FunctionTestAcceptEncodingIsDropped
(t *testing.T)
compress_test.go:64
FunctionTestBadDomain
(t *testing.T)
canonical_test.go:67
FunctionTestCORSAllowStar
(t *testing.T)
cors_test.go:407
FunctionTestCORSHandlerAllowMethodsNotSetForSimpleRequestPreflight
(t *testing.T)
cors_test.go:189
FunctionTestCORSHandlerAllowedCredentials
(t *testing.T)
cors_test.go:301
FunctionTestCORSHandlerAllowedHeaderForPreflight
(t *testing.T)
cors_test.go:238
FunctionTestCORSHandlerAllowedHeaderNotSetForSimpleRequestPreflight
(t *testing.T)
cors_test.go:213
FunctionTestCORSHandlerAllowedMethodForPreflight
(t *testing.T)
cors_test.go:167
FunctionTestCORSHandlerIgnoreOptionsFallsThrough
(t *testing.T)
cors_test.go:38
FunctionTestCORSHandlerInvalidHeaderForPreflightForbidden
(t *testing.T)
cors_test.go:261
FunctionTestCORSHandlerInvalidRequestMethodForPreflightMethodNotAllowed
(t *testing.T)
cors_test.go:92
FunctionTestCORSHandlerMaxAgeForPreflight
(t *testing.T)
cors_test.go:279
FunctionTestCORSHandlerMultipleAllowOriginsSetsVaryHeader
(t *testing.T)
cors_test.go:322
FunctionTestCORSHandlerOptionsRequestMustNotBePassedToNextHandler
(t *testing.T)
cors_test.go:109
FunctionTestCORSHandlerOptionsRequestMustNotBePassedToNextHandlerWhenOriginNotAllowed
(t *testing.T)
cors_test.go:148
FunctionTestCORSHandlerOptionsRequestMustNotBePassedToNextHandlerWithCustomStatusCode
(t *testing.T)
cors_test.go:128
FunctionTestCORSHandlerSetsExposedHeaders
(t *testing.T)
cors_test.go:56
FunctionTestCORSHandlerUnsetRequestMethodForPreflightBadRequest
(t *testing.T)
cors_test.go:77
FunctionTestCORSOriginValidatorWithExplicitStar
(t *testing.T)
cors_test.go:385
FunctionTestCORSOriginValidatorWithImplicitStar
(t *testing.T)
cors_test.go:366
FunctionTestCORSWithMultipleHandlers
(t *testing.T)
cors_test.go:343
FunctionTestCanonicalHost
(t *testing.T)
canonical_test.go:31
FunctionTestCleanHost
(t *testing.T)
canonical_test.go:14
FunctionTestCompressFile
Make sure we can compress and serve an *os.File properly. We need to use a real http server to trigger the net/http sendfile special case.
compress_test.go:177
FunctionTestCompressHandlerDeflate
(t *testing.T)
compress_test.go:147
FunctionTestCompressHandlerDoesntInventInterfaces
(t *testing.T)
compress_test.go:282
FunctionTestCompressHandlerGzip
(t *testing.T)
compress_test.go:129
FunctionTestCompressHandlerGzipDeflate
(t *testing.T)
compress_test.go:162
FunctionTestCompressHandlerNoCompression
(t *testing.T)
compress_test.go:43
FunctionTestCompressHandlerPreserveInterfaces
(t *testing.T)
compress_test.go:242
FunctionTestContentTypeHandler
(t *testing.T)
handlers_test.go:84
FunctionTestDefaultCORSHandlerReturnsOk
(t *testing.T)
cors_test.go:10
FunctionTestDefaultCORSHandlerReturnsOkWithOrigin
(t *testing.T)
cors_test.go:23
FunctionTestEmptyHost
(t *testing.T)
canonical_test.go:81
FunctionTestGetIP
(t *testing.T)
proxy_headers_test.go:15
FunctionTestGetScheme
(t *testing.T)
proxy_headers_test.go:46
next →1–100 of 125, ranked by callers