🐛 Bug fixes infinite redirecting
Some checks are pending
release-nightly / build-docker (push) Waiting to run
Some checks are pending
release-nightly / build-docker (push) Waiting to run
This commit is contained in:
@ -9,7 +9,6 @@ import (
|
||||
"github.com/gofiber/fiber/v2/utils"
|
||||
"github.com/rs/zerolog/log"
|
||||
"github.com/samber/lo"
|
||||
"github.com/spf13/viper"
|
||||
"github.com/valyala/fasthttp"
|
||||
"io/fs"
|
||||
"net/http"
|
||||
@ -32,10 +31,11 @@ func makeUnifiedResponse(c *fiber.Ctx, dest *Destination) error {
|
||||
}
|
||||
|
||||
func makeHypertextResponse(c *fiber.Ctx, dest *Destination) error {
|
||||
timeout := time.Duration(viper.GetInt64("performance.network_timeout")) * time.Millisecond
|
||||
return proxy.Do(c, dest.MakeUri(c), &fasthttp.Client{
|
||||
ReadTimeout: timeout,
|
||||
WriteTimeout: timeout,
|
||||
limit := 60 * time.Millisecond
|
||||
uri := dest.MakeUri(c)
|
||||
return proxy.Do(c, uri, &fasthttp.Client{
|
||||
ReadTimeout: limit,
|
||||
WriteTimeout: limit,
|
||||
})
|
||||
}
|
||||
|
||||
|
@ -75,9 +75,10 @@ func (v *Destination) MakeUri(ctx *fiber.Ctx) string {
|
||||
|
||||
path := string(ctx.Request().URI().Path())
|
||||
hash := string(ctx.Request().URI().Hash())
|
||||
protocol := v.GetProtocol()
|
||||
uri, _ := v.GetRawUri()
|
||||
|
||||
return uri + path +
|
||||
return protocol + "://" + uri + path +
|
||||
lo.Ternary(len(queries) > 0, "?"+strings.Join(queries, "&"), "") +
|
||||
lo.Ternary(len(hash) > 0, "#"+hash, "")
|
||||
}
|
||||
|
Reference in New Issue
Block a user