mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2026-01-28 01:21:16 +00:00
implement x-forwarded-proto
This commit is contained in:
@@ -3,9 +3,12 @@ package utils
|
||||
import "github.com/gofiber/fiber/v2"
|
||||
|
||||
func GetInstanceUrl(c *fiber.Ctx) string {
|
||||
proto := "https://"
|
||||
proto := "https"
|
||||
if !Config.Secure {
|
||||
proto = "http://"
|
||||
proto = "http"
|
||||
}
|
||||
return proto + c.Hostname()
|
||||
if Config.ProtocolDetection {
|
||||
proto = c.Get("X-Forwarded-Proto", proto)
|
||||
}
|
||||
return proto + "://" + c.Hostname()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user