Skip to content

Commit

Permalink
Fix syntax issue
Browse files Browse the repository at this point in the history
  • Loading branch information
gaby authored Mar 17, 2024
1 parent e7ee21f commit 1af71a3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions middleware/cors/cors_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -724,9 +724,9 @@ func Test_CORS_AllowPrivateNetwork(t *testing.T) {
require.Equal(t, "", string(ctx.Response.Header.Peek("Access-Control-Allow-Private-Network")), "The Access-Control-Allow-Private-Network header should not be present by default")

// Test scenario where AllowPrivateNetwork is disabled but client sends header
app := fiber.New()
app = fiber.New()
app.Use(New())
handler := app.Handler()
handler = app.Handler()

ctx = &fasthttp.RequestCtx{}
ctx.Request.Header.SetMethod(fiber.MethodOptions)
Expand All @@ -738,11 +738,11 @@ func Test_CORS_AllowPrivateNetwork(t *testing.T) {
require.Equal(t, "", string(ctx.Response.Header.Peek("Access-Control-Allow-Private-Network")), "The Access-Control-Allow-Private-Network header should not be present by default")

// Test scenario where AllowPrivateNetwork is enabled and client does NOT send header
app := fiber.New()
app = fiber.New()
app.Use(New(Config{
AllowPrivateNetwork: true,
}))
handler := app.Handler()
handler = app.Handler()

ctx = &fasthttp.RequestCtx{}
ctx.Request.Header.SetMethod(fiber.MethodOptions)
Expand Down

0 comments on commit 1af71a3

Please sign in to comment.