luci-app-mosdns: init at 97867ea
This commit is contained in:
parent
6c536e3c19
commit
187069bd1e
8 changed files with 320 additions and 0 deletions
|
@ -0,0 +1,24 @@
|
|||
From 0b86b89629f32e7c8b859239aa1a4814f256053c Mon Sep 17 00:00:00 2001
|
||||
From: sbwml <admin@cooluc.com>
|
||||
Date: Thu, 28 Sep 2023 16:42:54 +0800
|
||||
Subject: [PATCH 3/5] add response for bad request in ServeHTTP handler
|
||||
|
||||
---
|
||||
pkg/server/http_handler.go | 1 +
|
||||
1 file changed, 1 insertion(+)
|
||||
|
||||
diff --git a/pkg/server/http_handler.go b/pkg/server/http_handler.go
|
||||
index 5a41314..8f33b3f 100644
|
||||
--- a/pkg/server/http_handler.go
|
||||
+++ b/pkg/server/http_handler.go
|
||||
@@ -93,6 +93,7 @@ func (h *HttpHandler) ServeHTTP(w http.ResponseWriter, req *http.Request) {
|
||||
if err != nil {
|
||||
h.warnErr(req, "invalid request", err)
|
||||
w.WriteHeader(http.StatusBadRequest)
|
||||
+ w.Write([]byte("Bad Request"))
|
||||
return
|
||||
}
|
||||
|
||||
--
|
||||
2.42.0
|
||||
|
Loading…
Add table
Add a link
Reference in a new issue