From 8b4211717e168094a3318ed05a671301100b9ee5 Mon Sep 17 00:00:00 2001 From: wang yan Date: Fri, 6 Mar 2020 00:34:23 +0800 Subject: [PATCH] skip configuration update in readonly mode Admin must have a way to switch off the readonly by call configuration api, either internal or external. Signed-off-by: wang yan --- src/core/middlewares/middlewares.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/middlewares/middlewares.go b/src/core/middlewares/middlewares.go index 4c353a580e..87ed583bdb 100644 --- a/src/core/middlewares/middlewares.go +++ b/src/core/middlewares/middlewares.go @@ -41,6 +41,8 @@ var ( // readonlySkippers skip the post request when harbor sets to readonly. readonlySkippers = []middleware.Skipper{ + middleware.MethodAndPathSkipper(http.MethodPut, match("^/api/v2.0/configurations")), + middleware.MethodAndPathSkipper(http.MethodPut, match("^/api/internal/configurations")), middleware.MethodAndPathSkipper(http.MethodPost, match("^/c/login")), middleware.MethodAndPathSkipper(http.MethodPost, match("^/c/userExists")), middleware.MethodAndPathSkipper(http.MethodPost, match("^/c/oidc/onboard")),