203-add-response-for-bad-request-in-ServeHTTP-handler.patch 558 B

12345678910111213141516171819
  1. From 0b86b89629f32e7c8b859239aa1a4814f256053c Mon Sep 17 00:00:00 2001
  2. From: sbwml <[email protected]>
  3. Date: Thu, 28 Sep 2023 16:42:54 +0800
  4. Subject: [PATCH 3/5] add response for bad request in ServeHTTP handler
  5. ---
  6. pkg/server/http_handler.go | 1 +
  7. 1 file changed, 1 insertion(+)
  8. --- a/pkg/server/http_handler.go
  9. +++ b/pkg/server/http_handler.go
  10. @@ -93,6 +93,7 @@ func (h *HttpHandler) ServeHTTP(w http.R
  11. if err != nil {
  12. h.warnErr(req, "invalid request", err)
  13. w.WriteHeader(http.StatusBadRequest)
  14. + w.Write([]byte("Bad Request"))
  15. return
  16. }