From 0e21d35e802bf859aa14bce688cd9544458e9e9c Mon Sep 17 00:00:00 2001 From: Louis Brauer Date: Sun, 26 May 2024 21:45:41 +0200 Subject: Use enum instead of numeric status codes for HTTP statuses --- webfinger.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'webfinger.c') diff --git a/webfinger.c b/webfinger.c index c79fd44..0c18362 100644 --- a/webfinger.c +++ b/webfinger.c @@ -42,7 +42,7 @@ int webfinger_request_signed(snac *snac, const char *qs, char **actor, char **us } if (host == NULL || resource == NULL) - return 400; + return HTTP_STATUS_BAD_REQUEST; headers = xs_dict_append(headers, "accept", "application/json"); headers = xs_dict_append(headers, "user-agent", USER_AGENT); @@ -139,7 +139,7 @@ int webfinger_get_handler(xs_dict *req, char *q_path, const char *resource = xs_dict_get(q_vars, "resource"); if (resource == NULL) - return 400; + return HTTP_STATUS_BAD_REQUEST; snac snac; int found = 0; @@ -220,12 +220,12 @@ int webfinger_get_handler(xs_dict *req, char *q_path, user_free(&snac); - status = 200; + status = HTTP_STATUS_OK; *body = j; *ctype = "application/jrd+json"; } else - status = 404; + status = HTTP_STATUS_NOT_FOUND; srv_debug(1, xs_fmt("webfinger_get_handler resource=%s %d", resource, status)); -- cgit v1.2.3