mirror of
https://github.com/XTLS/Xray-core.git
synced 2024-12-22 19:33:32 +02:00
Add error log for ws host and path check
This commit is contained in:
parent
12f5b05aca
commit
32f0017449
1 changed files with 2 additions and 0 deletions
|
@ -39,10 +39,12 @@ var upgrader = &websocket.Upgrader{
|
|||
|
||||
func (h *requestHandler) ServeHTTP(writer http.ResponseWriter, request *http.Request) {
|
||||
if len(h.host) > 0 && request.Host != h.host {
|
||||
newError("failed to validate host, request:", request.Host, "config:", h.host).WriteToLog()
|
||||
writer.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
if request.URL.Path != h.path {
|
||||
newError("failed to validate path, request:", request.URL.Path, "config:", h.path).WriteToLog()
|
||||
writer.WriteHeader(http.StatusNotFound)
|
||||
return
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue