mirror of
https://github.com/prymitive/karma
synced 2026-05-09 03:36:44 +00:00
fix(backend): ensure 404s are never cached
This commit is contained in:
committed by
Łukasz Mierzwa
parent
9908b8f573
commit
41ce597cf5
@@ -99,6 +99,13 @@ func setupRouter(router *chi.Mux, historyPoller *historyPoller) {
|
||||
MaxAge: 300,
|
||||
}))
|
||||
|
||||
router.NotFound(func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Cache-Control", "no-cache, no-store, must-revalidate")
|
||||
contentText(w)
|
||||
w.WriteHeader(http.StatusNotFound)
|
||||
_, _ = w.Write([]byte("Not found"))
|
||||
})
|
||||
|
||||
allowAuthBypass := []string{
|
||||
getViewURL("/health"),
|
||||
getViewURL("/metrics"),
|
||||
|
||||
@@ -28,8 +28,8 @@ level=info msg="Removing PID file" path=karma.pid
|
||||
-- query.json --
|
||||
{
|
||||
"sources": [
|
||||
"http://127.0.0.1:9099",
|
||||
"http://127.0.0.1:9099"
|
||||
"http://127.0.0.1:6108",
|
||||
"http://127.0.0.1:6108"
|
||||
],
|
||||
"labels": {
|
||||
"alertname": "Fake Alert"
|
||||
|
||||
Reference in New Issue
Block a user