summaryrefslogtreecommitdiffstats
path: root/src/handler.c
diff options
context:
space:
mode:
authortiptorrent development team <tiptorrent@soleta.eu>2021-10-05 19:35:09 +0200
committertiptorrent development team <tiptorrent@soleta.eu>2021-10-05 19:35:32 +0200
commit7bf3eebb98488aeb1a5fd38a516c1c41f864f1fd (patch)
tree32bd4f20d47b04571aa4aba4088f83658646d431 /src/handler.c
parent138539485cc0b679cea7b54712ecf9ab5ad9a028 (diff)
update maximum uri length to 255 chars
file with a large name might easily reach the existing 32 chars limit.
Diffstat (limited to 'src/handler.c')
-rw-r--r--src/handler.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/handler.c b/src/handler.c
index 2b9c6a0..f689c6e 100644
--- a/src/handler.c
+++ b/src/handler.c
@@ -59,7 +59,7 @@ int tip_client_state_process_payload(struct tip_client *cli)
{
const char *trailer, *x_redirect;
bool allow_redirect = true;
- char _uri[32], *uri = _uri;
+ char _uri[256], *uri = _uri;
char allow_redirect_str[5];
char path[PATH_MAX + 1];
char *chunk = NULL;
@@ -72,15 +72,15 @@ int tip_client_state_process_payload(struct tip_client *cli)
if (!strncmp(cli->buf, "GET", strlen("GET"))) {
cli->method = TIP_METHOD_GET;
- if (sscanf(cli->buf, "GET %31s HTTP/1.1", uri) != 1)
+ if (sscanf(cli->buf, "GET %255s HTTP/1.1", uri) != 1)
return tip_client_method_not_found(cli);
} else if (!strncmp(cli->buf, "HEAD", strlen("HEAD"))) {
cli->method = TIP_METHOD_HEAD;
- if (sscanf(cli->buf, "HEAD %31s HTTP/1.1", uri) != 1)
+ if (sscanf(cli->buf, "HEAD %255s HTTP/1.1", uri) != 1)
return tip_client_method_not_found(cli);
} else if (!strncmp(cli->buf, "POST", strlen("POST"))) {
cli->method = TIP_METHOD_POST;
- if (sscanf(cli->buf, "POST %31s HTTP/1.1", uri) != 1)
+ if (sscanf(cli->buf, "POST %255s HTTP/1.1", uri) != 1)
return tip_client_method_not_found(cli);
} else {
return tip_client_method_not_found(cli);