mirror of
https://github.com/tobychui/zoraxy.git
synced 2025-06-01 13:17:21 +02:00
Fixed #450
This commit is contained in:
parent
d1e5581eea
commit
0d4c71d0f6
@ -42,7 +42,7 @@ import (
|
||||
const (
|
||||
/* Build Constants */
|
||||
SYSTEM_NAME = "Zoraxy"
|
||||
SYSTEM_VERSION = "3.1.6"
|
||||
SYSTEM_VERSION = "3.1.7"
|
||||
DEVELOPMENT_BUILD = false /* Development: Set to false to use embedded web fs */
|
||||
|
||||
/* System Constants */
|
||||
|
@ -191,7 +191,24 @@ func (router *Router) StartProxyService() error {
|
||||
w.Write([]byte("400 - Bad Request"))
|
||||
} else {
|
||||
//No defined sub-domain
|
||||
http.NotFound(w, r)
|
||||
if router.Root.DefaultSiteOption == DefaultSite_NoResponse {
|
||||
//No response. Just close the connection
|
||||
hijacker, ok := w.(http.Hijacker)
|
||||
if !ok {
|
||||
w.Header().Set("Connection", "close")
|
||||
return
|
||||
}
|
||||
conn, _, err := hijacker.Hijack()
|
||||
if err != nil {
|
||||
w.Header().Set("Connection", "close")
|
||||
return
|
||||
}
|
||||
conn.Close()
|
||||
} else {
|
||||
//Default behavior
|
||||
http.NotFound(w, r)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user