mirror of
https://github.com/goharbor/harbor.git
synced 2024-11-14 22:35:36 +01:00
skip transaction for POST /service/token (#19339)
Habor doesnot support POST /service/token endpoint, put this request into a transaction will consume extra database resources and generate many logs. Signed-off-by: bin liu <liubin0329@gmail.com>
This commit is contained in:
parent
ee6f61c502
commit
5a576174b1
@ -55,6 +55,7 @@ var (
|
||||
dbTxSkippers = []middleware.Skipper{
|
||||
middleware.MethodAndPathSkipper(http.MethodPatch, distribution.BlobUploadURLRegexp),
|
||||
middleware.MethodAndPathSkipper(http.MethodPut, distribution.BlobUploadURLRegexp),
|
||||
middleware.MethodAndPathSkipper(http.MethodPost, match("^/service/token")),
|
||||
func(r *http.Request) bool { // skip tx for GET, HEAD and Options requests
|
||||
m := r.Method
|
||||
return m == http.MethodGet || m == http.MethodHead || m == http.MethodOptions
|
||||
|
Loading…
Reference in New Issue
Block a user