(t *testing.T)
| 65 | } |
| 66 | |
| 67 | func createRedirectServer(t *testing.T) string { |
| 68 | t.Helper() |
| 69 | app := fiber.New() |
| 70 | |
| 71 | var addr string |
| 72 | app.Get("/", func(c fiber.Ctx) error { |
| 73 | c.Location("http://" + addr + "/final") |
| 74 | return c.Status(fiber.StatusMovedPermanently).SendString("redirect") |
| 75 | }) |
| 76 | app.Get("/final", func(c fiber.Ctx) error { |
| 77 | return c.SendString("final") |
| 78 | }) |
| 79 | |
| 80 | ln, err := net.Listen(fiber.NetworkTCP4, "127.0.0.1:0") |
| 81 | require.NoError(t, err) |
| 82 | t.Cleanup(func() { |
| 83 | ln.Close() //nolint:errcheck // It is fine to ignore the error here |
| 84 | }) |
| 85 | addr = ln.Addr().String() |
| 86 | |
| 87 | startServer(app, ln) |
| 88 | |
| 89 | return addr |
| 90 | } |
| 91 | |
| 92 | func restoreGlobalProxyClient(t *testing.T) { |
| 93 | t.Helper() |
no test coverage detected