Files
rimgo/utils/getUrl.go
orangix e8ed026962 add protocol to cache key (#241)
fixes #240

Reviewed-on: https://codeberg.org/rimgo/rimgo/pulls/241
Reviewed-by: video-prize-ranch <video-prize-ranch@noreply.codeberg.org>
Co-authored-by: orangix <uleo8b8g@anonaddy.me>
Co-committed-by: orangix <uleo8b8g@anonaddy.me>
2026-01-12 01:45:24 +01:00

19 lines
354 B
Go

package utils
import "github.com/gofiber/fiber/v2"
func GetInstanceProtocol(c *fiber.Ctx) string {
proto := "https"
if !Config.Secure {
proto = "http"
}
if Config.ProtocolDetection {
proto = c.Get("X-Forwarded-Proto", proto)
}
return proto
}
func GetInstanceUrl(c *fiber.Ctx) string {
return GetInstanceProtocol(c) + "://" + c.Hostname()
}