summaryrefslogtreecommitdiff
path: root/webfinger.c
diff options
context:
space:
mode:
authorLouis Brauer <louis@openbooking.ch>2024-05-26 21:45:41 +0200
committerLouis Brauer <louis@openbooking.ch>2024-05-26 21:45:41 +0200
commit0e21d35e802bf859aa14bce688cd9544458e9e9c (patch)
tree55861603d4f702d56edafe24aa1019484b714fbc /webfinger.c
parent9749a65007e88a6a7d8d98b6f6b98a1a47b46bdb (diff)
Use enum instead of numeric status codes for HTTP statuses
Diffstat (limited to 'webfinger.c')
-rw-r--r--webfinger.c8
1 files changed, 4 insertions, 4 deletions
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));