Skip to content

Commit

Permalink
Updated favicon check to only reject for the root domain
Browse files Browse the repository at this point in the history
  • Loading branch information
antoniomika committed May 23, 2020
1 parent ad7acfc commit af01eee
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions httpmuxer/httpmuxer.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,15 +100,15 @@ func Start(state *utils.State) {

return logLine
}), gin.Recovery(), func(c *gin.Context) {
hostname := strings.Split(c.Request.Host, ":")[0]
hostIsRoot := hostname == viper.GetString("domain")

// Return a 404 for the favicon.
if strings.HasPrefix(c.Request.URL.Path, "/favicon.ico") {
if hostIsRoot && strings.HasPrefix(c.Request.URL.Path, "/favicon.ico") {
c.AbortWithStatus(http.StatusNotFound)
return
}

hostname := strings.Split(c.Request.Host, ":")[0]
hostIsRoot := hostname == viper.GetString("domain")

if (viper.GetBool("admin-console") || viper.GetBool("service-console")) && strings.HasPrefix(c.Request.URL.Path, "/_sish/") {
state.Console.HandleRequest(hostname, hostIsRoot, c)
return
Expand Down

0 comments on commit af01eee

Please # to comment.