From 9290053f5b6acf3eaca02de44fea52f24eba8910 Mon Sep 17 00:00:00 2001 From: Jed Lu Date: Wed, 27 May 2020 13:38:44 +0100 Subject: [PATCH] ss: Support content-length on PUT as well as PUSH --- lib/secure-streams/protocols/ss-h1.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/secure-streams/protocols/ss-h1.c b/lib/secure-streams/protocols/ss-h1.c index ad06088fe..4d1568b51 100644 --- a/lib/secure-streams/protocols/ss-h1.c +++ b/lib/secure-streams/protocols/ss-h1.c @@ -364,10 +364,11 @@ malformed: } /* - * Content-length on POST if we have the length information + * Content-length on POST / PUT if we have the length information */ - if (!strcmp(h->policy->u.http.method, "POST") && + if ((!strcmp(h->policy->u.http.method, "POST") || + !strcmp(h->policy->u.http.method, "PUT")) && wsi->http.writeable_len) { if (!(h->policy->flags & LWSSSPOLF_HTTP_NO_CONTENT_LENGTH)) {