mirror of
https://github.com/steveiliop56/tinyauth.git
synced 2025-11-05 16:45:44 +00:00
refactor: remove port from domain before getting container
This commit is contained in:
@@ -69,11 +69,14 @@ func (h *Handlers) AuthHandler(c *gin.Context) {
|
|||||||
proto := c.Request.Header.Get("X-Forwarded-Proto")
|
proto := c.Request.Header.Get("X-Forwarded-Proto")
|
||||||
host := c.Request.Header.Get("X-Forwarded-Host")
|
host := c.Request.Header.Get("X-Forwarded-Host")
|
||||||
|
|
||||||
|
// Remove the port from the host if it exists
|
||||||
|
hostPortless := strings.Split(host, ":")[0] // *lol*
|
||||||
|
|
||||||
// Get the id
|
// Get the id
|
||||||
id := strings.Split(host, ".")[0]
|
id := strings.Split(hostPortless, ".")[0]
|
||||||
|
|
||||||
// Get the container labels
|
// Get the container labels
|
||||||
labels, err := h.Docker.GetLabels(id, host)
|
labels, err := h.Docker.GetLabels(id, hostPortless)
|
||||||
|
|
||||||
log.Debug().Interface("labels", labels).Msg("Got labels")
|
log.Debug().Interface("labels", labels).Msg("Got labels")
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user