mirror of
https://github.com/project-zot/zot.git
synced 2026-06-16 04:17:55 +08:00
build: fix mgmt and userprefs when building them separately (#1601)
move queryHasParams in common package fixes building mgmt and userprefs separately Signed-off-by: Petu Eusebiu <peusebiu@cisco.com>
This commit is contained in:
@@ -2,6 +2,7 @@ package common
|
||||
|
||||
import (
|
||||
"net/http"
|
||||
"net/url"
|
||||
"strconv"
|
||||
"strings"
|
||||
"time"
|
||||
@@ -82,6 +83,16 @@ func WriteData(w http.ResponseWriter, status int, mediaType string, data []byte)
|
||||
_, _ = w.Write(data)
|
||||
}
|
||||
|
||||
func QueryHasParams(values url.Values, params []string) bool {
|
||||
for _, param := range params {
|
||||
if !values.Has(param) {
|
||||
return false
|
||||
}
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
/*
|
||||
GetAuthUserFromRequestSession returns identity
|
||||
and auth status if on the request's cookie session is a logged in user.
|
||||
|
||||
Reference in New Issue
Block a user