feat: update full url generat

This commit is contained in:
yanghao05
2025-04-29 17:25:41 +08:00
parent d9a40dc636
commit c16890aec8
4 changed files with 24 additions and 8 deletions

View File

@@ -0,0 +1,19 @@
package utils
import (
"net/url"
"github.com/gofiber/fiber/v3"
)
func FullURI(ctx fiber.Ctx) string {
fullURL := string(ctx.Request().URI().FullURI())
u, err := url.Parse(fullURL)
if err != nil {
return ""
}
u.Scheme = ctx.Protocol()
u.Host = ctx.Host()
return u.String()
}