From f1f7512e8d21f03fb17e0da9c5dac0a5a3126799 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 9775a2a70..4d8cf70a9 100644 --- a/lib/secure-streams/protocols/ss-h1.c +++ b/lib/secure-streams/protocols/ss-h1.c @@ -352,10 +352,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)) {