diff options
| author | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-03-20 03:32:00 +0100 |
|---|---|---|
| committer | Xavier Del Campo Romero <xavi.dcr@tutanota.com> | 2023-03-20 10:57:20 +0100 |
| commit | d9bb874591c63f2efbfc1c4c953934251c700e9f (patch) | |
| tree | 88254b346628a22ece5a4ede5f411458969720c0 /http.h | |
| parent | d51b191ab7005de6679a00dd200ad5502ecff5ac (diff) | |
| download | slcl-d9bb874591c63f2efbfc1c4c953934251c700e9f.tar.gz | |
Send response on quota exceeded
So far, slcl would just close the connection with a client when the
Content-Length of an incoming request exceeded the user quota, without
any meaningful information given back to the user.
Now, slcl responds with a HTML file with meaningful information about
the error.
Limitations:
- While this commits has been successfully tested on ungoogled-chromium,
LibreWolf (and I assume Firefox and any other derivates too) does not
seem to receive the response from the server.
- However, this issue only occurred during local testing, but not
on remote instances.
Diffstat (limited to 'http.h')
| -rw-r--r-- | http.h | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -45,6 +45,7 @@ struct http_payload X(UNAUTHORIZED, "Unauthorized", 401) \ X(FORBIDDEN, "Forbidden", 403) \ X(NOT_FOUND, "Not found", 404) \ + X(PAYLOAD_TOO_LARGE, "Payload too large", 413) \ X(INTERNAL_ERROR, "Internal Server Error", 500) struct http_response @@ -80,7 +81,7 @@ struct http_cfg int (*payload)(const struct http_payload *p, struct http_response *r, void *user); int (*length)(unsigned long long len, const struct http_cookie *c, - void *user); + struct http_response *r, void *user); const char *tmpdir; void *user; }; |
