add scheme to list

This commit is contained in:
YouROK
2021-04-27 11:38:40 +03:00
parent 94b092b7d7
commit 1ffb868fcb
4 changed files with 23 additions and 7 deletions

14
server/utils/location.go Normal file
View File

@@ -0,0 +1,14 @@
package utils
import (
"github.com/gin-contrib/location"
"github.com/gin-gonic/gin"
)
func GetScheme(c *gin.Context) string {
url := location.Get(c)
if url == nil {
return "http"
}
return url.Scheme
}