Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/gin-contrib/cors
/ functions
Functions
48 in github.com/gin-contrib/cors
⨍
Functions
48
◇
Types & classes
4
↓ 11 callers
Function
performRequest
(r http.Handler, method, origin string)
cors_test.go:42
↓ 10 callers
Function
newTestRouter
(config Config)
cors_test.go:21
↓ 7 callers
Function
normalize
(values []string)
utils.go:67
↓ 5 callers
Method
AddExposeHeaders
AddExposeHeaders is allowed to add custom expose headers
cors.go:86
↓ 5 callers
Function
New
New returns the location middleware with user-defined custom configuration.
cors.go:207
↓ 5 callers
Function
convert
(s []string, c converter)
utils.go:84
↓ 4 callers
Method
Validate
Validate is check configuration of user defined.
cors.go:131
↓ 4 callers
Method
parseWildcardRules
()
cors.go:157
↓ 3 callers
Function
performRequestWithHeaders
( r http.Handler, method, path, origin string, header http.Header, )
cors_test.go:46
↓ 2 callers
Method
AddAllowHeaders
AddAllowHeaders is allowed to add custom headers
cors.go:81
↓ 2 callers
Method
AddAllowMethods
AddAllowMethods is allowed to add custom methods
cors.go:76
↓ 2 callers
Function
DefaultConfig
DefaultConfig returns a generic default configuration mapped to localhost.
cors.go:190
↓ 2 callers
Function
generateNormalHeaders
(c Config)
utils.go:12
↓ 2 callers
Function
generatePreflightHeaders
(c Config)
utils.go:29
↓ 2 callers
Method
getAllowedSchemas
()
cors.go:90
↓ 2 callers
Function
newCors
(config Config)
config.go:43
↓ 2 callers
Method
validateOrigin
(origin string)
config.go:128
↓ 1 callers
Method
applyCors
(c *gin.Context)
config.go:71
↓ 1 callers
Method
handleNormal
(c *gin.Context)
config.go:162
↓ 1 callers
Method
handlePreflight
(c *gin.Context)
config.go:155
↓ 1 callers
Method
isOriginValid
(c *gin.Context, origin string)
config.go:118
↓ 1 callers
Function
multiGroupRouter
(config Config)
cors_test.go:30
↓ 1 callers
Method
validateAllowedSchemas
(origin string)
cors.go:109
↓ 1 callers
Method
validateWildcardOrigin
(origin string)
config.go:102
Function
Default
Default returns the location middleware with default configuration.
cors.go:200
Function
TestBadConfig
(t *testing.T)
cors_test.go:78
Function
TestCORS_AllowOrigins_AllowedOrigin
(t *testing.T)
cors_test.go:375
Function
TestCORS_AllowOrigins_DeniedOrigin
(t *testing.T)
cors_test.go:402
Function
TestCORS_AllowOrigins_DeniedPreflight
(t *testing.T)
cors_test.go:444
Function
TestCORS_AllowOrigins_NoOrigin
(t *testing.T)
cors_test.go:337
Function
TestCORS_AllowOrigins_OriginIsHost
(t *testing.T)
cors_test.go:355
Function
TestCORS_AllowOrigins_Preflight
(t *testing.T)
cors_test.go:420
Function
TestConfigAddAllow
(t *testing.T)
cors_test.go:61
Function
TestConvert
(t *testing.T)
cors_test.go:101
Function
TestDefaultConfig
(t *testing.T)
cors_test.go:326
Function
TestGenerateNormalHeaders
(t *testing.T)
cors_test.go:108
Function
TestGeneratePreflightHeaders
(t *testing.T)
cors_test.go:151
Function
TestMultiGroupRouter
(t *testing.T)
cors_test.go:537
Function
TestNormalize
(t *testing.T)
cors_test.go:93
Function
TestParseWildcardRules
(t *testing.T)
cors_test.go:598
Function
TestParseWildcardRules_InvalidWildcard
(t *testing.T)
cors_test.go:586
Function
TestParseWildcardRules_NoWildcard
(t *testing.T)
cors_test.go:574
Function
TestPassesAllowAllOrigins
(t *testing.T)
cors_test.go:464
Function
TestValidateAllowedSchemasWithAnchoredPatterns
TestValidateAllowedSchemasWithAnchoredPatterns tests that regex patterns with ^ anchor pass schema validation after stripping the leading ^ for schema
cors_test.go:664
Function
TestValidateOrigin
(t *testing.T)
cors_test.go:212
Function
TestValidateTauri
(t *testing.T)
cors_test.go:311
Function
TestWildcard
(t *testing.T)
cors_test.go:495
Function
main
()
_examples/example.go:10