From 96896eb092c3b4e0760e56d5228ef0d604951a12 Mon Sep 17 00:00:00 2001 From: Jan Harkes Date: Mon, 18 Feb 2013 16:15:36 -0500 Subject: [PATCH] Handle empty CONTENT_LENGTH environment variable. nginx seems to be providing a CONTENT_LENGTH environment variable with no data when the request body is empty. Signed-off-by: Jan Harkes --- src/rgw/rgw_rest.cc | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_rest.cc b/src/rgw/rgw_rest.cc index ab3927e7a627..363feac56c1f 100644 --- a/src/rgw/rgw_rest.cc +++ b/src/rgw/rgw_rest.cc @@ -1164,8 +1164,9 @@ int RGWREST::preprocess(struct req_state *s, RGWClientIO *cio) s->length = s->env->get("CONTENT_LENGTH"); if (s->length) { if (*s->length == '\0') - return -EINVAL; - s->content_length = atoll(s->length); + s->content_length = 0; + else + s->content_length = atoll(s->length); } map::iterator giter; -- 2.47.3