mirror of
https://github.com/haiwen/seafile-server.git
synced 2025-09-01 15:36:37 +00:00
Return 404 when notification server is disabled (#643)
Co-authored-by: 杨赫然 <heran.yang@seafile.com>
This commit is contained in:
@@ -728,8 +728,7 @@ func getJWTTokenCB(rsp http.ResponseWriter, r *http.Request) *appError {
|
|||||||
repoID := vars["repoid"]
|
repoID := vars["repoid"]
|
||||||
|
|
||||||
if !option.EnableNotification {
|
if !option.EnableNotification {
|
||||||
err := fmt.Errorf("notification server is not enabled")
|
return &appError{nil, "", http.StatusNotFound}
|
||||||
return &appError{err, "", http.StatusInternalServerError}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
user, appErr := validateToken(r, repoID, false)
|
user, appErr := validateToken(r, repoID, false)
|
||||||
|
@@ -2508,6 +2508,11 @@ get_jwt_token_cb (evhtp_request_t *req, void *arg)
|
|||||||
goto out;
|
goto out;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!seaf->notif_mgr) {
|
||||||
|
evhtp_send_reply (req, EVHTP_RES_NOTFOUND);
|
||||||
|
goto out;
|
||||||
|
}
|
||||||
|
|
||||||
jwt_token = gen_jwt_token (repo_id, username);
|
jwt_token = gen_jwt_token (repo_id, username);
|
||||||
if (!jwt_token) {
|
if (!jwt_token) {
|
||||||
seaf_warning ("Failed to gen jwt token for repo %s\n", repo_id);
|
seaf_warning ("Failed to gen jwt token for repo %s\n", repo_id);
|
||||||
|
Reference in New Issue
Block a user