Namespace is a query param
This commit is contained in:
@@ -9,20 +9,17 @@ import (
|
||||
"local/dndex/storage/entity"
|
||||
"local/dndex/storage/operator"
|
||||
"net/http"
|
||||
"path"
|
||||
"strings"
|
||||
|
||||
"github.com/buger/jsonparser"
|
||||
"go.mongodb.org/mongo-driver/bson"
|
||||
)
|
||||
|
||||
func who(g storage.Graph, w http.ResponseWriter, r *http.Request) error {
|
||||
namespace := strings.TrimLeft(r.URL.Path, path.Dir(r.URL.Path))
|
||||
namespace := r.URL.Query().Get("namespace")
|
||||
if len(namespace) == 0 {
|
||||
http.NotFound(w, r)
|
||||
return nil
|
||||
}
|
||||
namespace = strings.Replace(namespace, "/", ".", -1)
|
||||
|
||||
switch r.Method {
|
||||
case http.MethodGet:
|
||||
|
||||
Reference in New Issue
Block a user