[server] Fix resource resolution when using hosts.

This commit is contained in:
Ciprian Dorin Craciun 2022-08-26 17:42:36 +03:00
parent 137155cc1f
commit e7c8a0cc4d

View file

@ -155,13 +155,13 @@ func (_server *server) ServeUnwrapped (_context *fasthttp.RequestCtx) () {
var _referencesValues [2]uint64 var _referencesValues [2]uint64
var _referencesBuffer []byte var _referencesBuffer []byte
if !_referencesFound { for _hostIdx := 0; _hostIdx < 2; _hostIdx += 1 {
for _hostIdx := 0; _hostIdx < 2; _hostIdx += 1 { if (_hostIdx == 0) && _server.hostsDisabled {
continue
if (_hostIdx == 0) && _server.hostsDisabled { }
continue
} if !_referencesFound {
for _, _namespace := range _namespaces_a_static { for _, _namespace := range _namespaces_a_static {
@ -195,27 +195,16 @@ func (_server *server) ServeUnwrapped (_context *fasthttp.RequestCtx) () {
break break
} }
} }
if _referencesFound {
break
}
} }
}
if !_referencesFound {
if bytes.Equal (StringToBytes ("/favicon.ico"), _path) {
_server.ServeStatic (_context, http.StatusOK, FaviconData, FaviconContentType, FaviconContentEncoding, true)
return
}
}
if !_referencesFound {
for _hostIdx := 0; _hostIdx < 2; _hostIdx += 1 { if !_referencesFound {
if bytes.Equal (StringToBytes ("/favicon.ico"), _path) {
if (_hostIdx == 0) && _server.hostsDisabled { _server.ServeStatic (_context, http.StatusOK, FaviconData, FaviconContentType, FaviconContentEncoding, true)
continue return
} }
}
if !_referencesFound {
for for
_pathLimit := bytes.LastIndexByte (_path, '/'); _pathLimit := bytes.LastIndexByte (_path, '/');
@ -261,10 +250,10 @@ func (_server *server) ServeUnwrapped (_context *fasthttp.RequestCtx) () {
break break
} }
} }
}
if _referencesFound {
break if _referencesFound {
} break
} }
} }