File tree Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Expand file tree Collapse file tree 1 file changed +11
-0
lines changed Original file line number Diff line number Diff line change @@ -314,6 +314,17 @@ func TestValidateTauri(t *testing.T) {
314
314
assert .Nil (t , c .Validate ())
315
315
}
316
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
+
317
328
func TestPassesAllowOrigins (t * testing.T ) {
318
329
router := newTestRouter (Config {
319
330
AllowOrigins : []string {"http://google.com" },
You can’t perform that action at this time.
0 commit comments