fix: bug with authorizer url

This commit is contained in:
Lakhan Samani
2022-01-31 11:35:24 +05:30
parent 34a91f3195
commit 4e48320cf1
60 changed files with 156 additions and 148 deletions

View File

@@ -1,10 +1,23 @@
package utils
import (
"log"
"net/url"
"strings"
"github.com/gin-gonic/gin"
)
// GetHost returns hostname from request context
func GetHost(c *gin.Context) string {
scheme := "http"
if c.Request.TLS != nil {
scheme = "https"
}
log.Println("=> url:", scheme+"://"+c.Request.Host)
return scheme + "://" + c.Request.Host
}
// GetHostName function returns hostname and port
func GetHostParts(uri string) (string, string) {
tempURI := uri