mirror of
https://codeberg.org/video-prize-ranch/rimgo.git
synced 2026-04-19 22:04:47 -04:00
implement x-forwarded-proto
This commit is contained in:
+6
-3
@@ -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