diff --git a/fileserver/sync_api.go b/fileserver/sync_api.go index 4a0161ca..acbad47a 100644 --- a/fileserver/sync_api.go +++ b/fileserver/sync_api.go @@ -728,8 +728,7 @@ func getJWTTokenCB(rsp http.ResponseWriter, r *http.Request) *appError { repoID := vars["repoid"] if !option.EnableNotification { - err := fmt.Errorf("notification server is not enabled") - return &appError{err, "", http.StatusInternalServerError} + return &appError{nil, "", http.StatusNotFound} } user, appErr := validateToken(r, repoID, false) diff --git a/server/http-server.c b/server/http-server.c index dc2f38d8..79b9164d 100644 --- a/server/http-server.c +++ b/server/http-server.c @@ -2508,6 +2508,11 @@ get_jwt_token_cb (evhtp_request_t *req, void *arg) goto out; } + if (!seaf->notif_mgr) { + evhtp_send_reply (req, EVHTP_RES_NOTFOUND); + goto out; + } + jwt_token = gen_jwt_token (repo_id, username); if (!jwt_token) { seaf_warning ("Failed to gen jwt token for repo %s\n", repo_id);