diff options
author | wxiaoguang <wxiaoguang@gmail.com> | 2023-12-25 20:13:18 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-25 20:13:18 +0800 |
commit | b41925cee3d67a1fe546c7a219174e4a8b2302b7 (patch) | |
tree | c5d40048ba59379dc62821a19ecb4257499a6ee6 /routers/web/misc | |
parent | d0f24ff4cad05c1145afeca791e7d02fe146d46a (diff) | |
download | gitea-b41925cee3d67a1fe546c7a219174e4a8b2302b7.tar.gz gitea-b41925cee3d67a1fe546c7a219174e4a8b2302b7.zip |
Refactor CORS handler (#28587)
The CORS code has been unmaintained for long time, and the behavior is
not correct.
This PR tries to improve it. The key point is written as comment in
code. And add more tests.
Fix #28515
Fix #27642
Fix #17098
Diffstat (limited to 'routers/web/misc')
-rw-r--r-- | routers/web/misc/misc.go | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/routers/web/misc/misc.go b/routers/web/misc/misc.go index e351994010..54c93763f6 100644 --- a/routers/web/misc/misc.go +++ b/routers/web/misc/misc.go @@ -33,10 +33,6 @@ func DummyOK(w http.ResponseWriter, req *http.Request) { w.WriteHeader(http.StatusOK) } -func DummyBadRequest(w http.ResponseWriter, req *http.Request) { - w.WriteHeader(http.StatusBadRequest) -} - func RobotsTxt(w http.ResponseWriter, req *http.Request) { robotsTxt := util.FilePathJoinAbs(setting.CustomPath, "public/robots.txt") if ok, _ := util.IsExist(robotsTxt); !ok { |