We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 4447aeb commit 84d0919Copy full SHA for 84d0919
cors_test.go
@@ -314,6 +314,17 @@ func TestValidateTauri(t *testing.T) {
314
assert.Nil(t, c.Validate())
315
}
316
317
+func TestDefaultConfig(t *testing.T) {
318
+ config := DefaultConfig()
319
+ config.AllowAllOrigins = true
320
+ router := newTestRouter(config)
321
+ w := performRequest(router, "GET", "http://google.com")
322
+ assert.Equal(t, "get", w.Body.String())
323
+ assert.Equal(t, "*", w.Header().Get("Access-Control-Allow-Origin"))
324
+ assert.Empty(t, w.Header().Get("Access-Control-Allow-Credentials"))
325
+ assert.Empty(t, w.Header().Get("Access-Control-Expose-Headers"))
326
+}
327
+
328
func TestPassesAllowOrigins(t *testing.T) {
329
router := newTestRouter(Config{
330
AllowOrigins: []string{"http://google.com"},
0 commit comments