luci-app-mosdns: init at 97867ea

This commit is contained in:
xinyangli 2024-05-24 00:40:16 +08:00
parent 6c536e3c19
commit 187069bd1e
Signed by: xin
SSH key fingerprint: SHA256:qZ/tzd8lYRtUFSrfBDBMcUqV4GHKxqeqRA3huItgvbk
8 changed files with 320 additions and 0 deletions

View file

@ -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