diff --git a/src/auth.c b/src/auth.c index df3db8d..4ac836e 100644 --- a/src/auth.c +++ b/src/auth.c @@ -90,12 +90,12 @@ kore_auth_run(struct http_request *req, struct kore_auth *auth) kore_debug("kore_auth_run() for %s failed", req->path); if (auth->redirect == NULL) { - http_response(req, 403, NULL, 0); + http_response(req, HTTP_STATUS_FORBIDDEN, NULL, 0); return (KORE_RESULT_ERROR); } http_response_header(req, "location", auth->redirect); - http_response(req, 302, NULL, 0); + http_response(req, HTTP_STATUS_FOUND, NULL, 0); return (KORE_RESULT_ERROR); } diff --git a/src/jsonrpc.c b/src/jsonrpc.c index 7e295d8..fee40ff 100644 --- a/src/jsonrpc.c +++ b/src/jsonrpc.c @@ -423,13 +423,13 @@ jsonrpc_error(struct jsonrpc_request *req, int code, const char *msg) http_response_header(req->http, "content-type", "application/json"); yajl_gen_get_buf(req->gen, &body, &body_len); succeeded: - http_response(req->http, 200, body, body_len); + http_response(req->http, HTTP_STATUS_OK, body, body_len); if (req->gen != NULL) yajl_gen_clear(req->gen); jsonrpc_destroy_request(req); return (KORE_RESULT_OK); failed: - http_response(req->http, 500, NULL, 0); + http_response(req->http, HTTP_STATUS_INTERNAL_ERROR, NULL, 0); jsonrpc_destroy_request(req); return (KORE_RESULT_OK); } @@ -466,13 +466,13 @@ jsonrpc_result(struct jsonrpc_request *req, http_response_header(req->http, "content-type", "application/json"); yajl_gen_get_buf(req->gen, &body, &body_len); succeeded: - http_response(req->http, 200, body, body_len); + http_response(req->http, HTTP_STATUS_OK, body, body_len); if (req->gen != NULL) yajl_gen_clear(req->gen); jsonrpc_destroy_request(req); return (KORE_RESULT_OK); failed: - http_response(req->http, 500, NULL, 0); + http_response(req->http, HTTP_STATUS_INTERNAL_ERROR, NULL, 0); jsonrpc_destroy_request(req); return (KORE_RESULT_OK); }