fix: env.json caching, readiness and unique lockerIDs (#3596)

* fix: readiness check

* disable cache for env.json

* always generate unique lockerID

* fix tests
This commit is contained in:
Livio Amstutz
2022-05-04 17:09:49 +02:00
committed by GitHub
parent 929ed8745a
commit 94e420bb24
11 changed files with 8 additions and 276 deletions

View File

@@ -73,7 +73,7 @@ func Start(config Config, externalSecure bool, issuer op.IssuerFromRequest, inst
security := middleware.SecurityHeaders(csp(), nil)
handler := mux.NewRouter()
handler.Use(cache, security)
handler.Use(security)
handler.Handle(envRequestPath, middleware.TelemetryHandler()(instanceHandler(http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
instance := authz.GetInstance(r.Context())
if instance.InstanceID() == "" {
@@ -89,7 +89,7 @@ func Start(config Config, externalSecure bool, issuer op.IssuerFromRequest, inst
_, err = w.Write(environmentJSON)
logging.OnError(err).Error("error serving environment.json")
}))))
handler.SkipClean(true).PathPrefix("").Handler(http.FileServer(&spaHandler{http.FS(fSys)}))
handler.SkipClean(true).PathPrefix("").Handler(cache(http.FileServer(&spaHandler{http.FS(fSys)})))
return handler, nil
}