commit b3af603

grunfink  ·  2026-08-06 17:00:20 +0000 UTC
parent ca60d65
Fixed redirection loop in the /users special case.
1 files changed,  +2, -2
+2, -2
 1@@ -504,9 +504,9 @@ void httpd_connection(FILE *f)
 2         q_path = xs_crop_i(q_path, strlen(p), 0);
 3 
 4     /* add users endpoint redirection mimic Mastodon behaviour */
 5-    const char *users_endpoint = "/users";
 6+    const char *users_endpoint = "/users/";
 7     if (xs_startswith(q_path, users_endpoint)) {
 8-        q_path = xs_crop_i(q_path, strlen(users_endpoint), 0);
 9+        q_path = xs_crop_i(q_path, strlen(users_endpoint) - 1, 0);
10         status = HTTP_STATUS_FOUND;
11     }
12