Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/go-chi/cors
/ functions
Functions
35 in github.com/go-chi/cors
⨍
Functions
35
◇
Types & classes
5
↓ 11 callers
Function
New
New creates a new Cors handler with the provided options.
cors.go:114
↓ 11 callers
Method
logf
convenience method. checks if a logger is set.
cors.go:333
↓ 7 callers
Method
match
(s string)
utils.go:14
↓ 7 callers
Function
parseHeaderList
parseHeaderList tokenize + normalize a string containing a list of headers
utils.go:28
↓ 5 callers
Function
assertHeaders
(t *testing.T, resHeaders http.Header, expHeaders map[string]string)
cors_test.go:25
↓ 4 callers
Function
convert
convert converts a list of string using the passed converter function
utils.go:19
↓ 4 callers
Method
isMethodAllowed
isMethodAllowed checks if a given method can be used as part of a cross-domain request on the endpoint
cors.go:364
↓ 3 callers
Method
handleActualRequest
handleActualRequest handles simple cross-origin requests, actual request or redirects
cors.go:291
↓ 3 callers
Method
handlePreflight
handlePreflight handles pre-flight CORS requests
cors.go:237
↓ 2 callers
Method
isOriginAllowed
isOriginAllowed checks if a given origin is allowed to perform cross-domain requests on the endpoint
cors.go:341
↓ 1 callers
Function
Handler
Handler creates a new Cors handler with passed options.
cors.go:186
↓ 1 callers
Method
Handler
Handler apply the CORS specification on the request, and add relevant CORS headers as necessary.
cors.go:211
↓ 1 callers
Method
Printf
(string, ...interface{})
cors.go:76
↓ 1 callers
Method
areHeadersAllowed
areHeadersAllowed checks if a given list of headers are allowed to used within a cross-domain request.
cors.go:384
Function
AllowAll
AllowAll create a new Cors handler with permissive configuration allowing all origins with all standard methods with any header and credentials.
cors.go:193
Function
AllowOriginFunc
(r *http.Request, origin string)
_example/main.go:79
Function
BenchmarkParseHeaderList
(b *testing.B)
utils_test.go:51
Function
BenchmarkParseHeaderListNormalized
(b *testing.B)
utils_test.go:65
Function
BenchmarkParseHeaderListSingle
(b *testing.B)
utils_test.go:58
Function
BenchmarkWildcard
(b *testing.B)
utils_test.go:72
Function
TestConvert
(t *testing.T)
utils_test.go:26
Function
TestDebug
(t *testing.T)
cors_test.go:403
Function
TestDefault
(t *testing.T)
cors_test.go:413
Function
TestHandleActualRequestInvalidMethodAbortion
(t *testing.T)
cors_test.go:471
Function
TestHandleActualRequestInvalidOriginAbortion
(t *testing.T)
cors_test.go:456
Function
TestHandlePreflightInvalidOriginAbortion
(t *testing.T)
cors_test.go:429
Function
TestHandlePreflightNoOptionsAbortion
(t *testing.T)
cors_test.go:444
Function
TestIsMethodAllowedReturnsFalseWithNoMethods
(t *testing.T)
cors_test.go:487
Function
TestIsMethodAllowedReturnsTrueWithOptions
(t *testing.T)
cors_test.go:497
Function
TestParseHeaderList
(t *testing.T)
utils_test.go:34
Function
TestParseHeaderListEmpty
(t *testing.T)
utils_test.go:42
Function
TestSpec
(t *testing.T)
cors_test.go:41
Function
TestWildcard
(t *testing.T)
utils_test.go:8
Function
assertResponse
(t *testing.T, res *httptest.ResponseRecorder, responseCode int)
cors_test.go:35
Function
main
()
_example/main.go:57