diff --git a/lib/api/api.go b/lib/api/api.go index 750d6dd..cba75c3 100644 --- a/lib/api/api.go +++ b/lib/api/api.go @@ -60,5 +60,9 @@ func getUserId(request *http.Request) (string, error) { } return forUser, nil } - return request.Header.Get("X-UserId"), nil + userid := request.Header.Get("X-UserId") + if userid == "" { + return "", errors.New("X-UserId not set") + } + return userid, nil }