mirror of
https://github.com/yusing/godoxy.git
synced 2026-04-24 01:38:50 +02:00
added response message on invalid api request host
This commit is contained in:
@@ -44,6 +44,7 @@ func checkHost(f http.HandlerFunc) http.HandlerFunc {
|
|||||||
if r.Host != common.APIHTTPAddr {
|
if r.Host != common.APIHTTPAddr {
|
||||||
Logger.Warnf("invalid request to API server with host: %s, expected: %s", r.Host, common.APIHTTPAddr)
|
Logger.Warnf("invalid request to API server with host: %s, expected: %s", r.Host, common.APIHTTPAddr)
|
||||||
w.WriteHeader(http.StatusNotFound)
|
w.WriteHeader(http.StatusNotFound)
|
||||||
|
w.Write([]byte("invalid request"))
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
f(w, r)
|
f(w, r)
|
||||||
|
|||||||
Reference in New Issue
Block a user