From bfe30464bc372533f08d61d07633c6942bfd3dbd Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Mon, 27 Jan 2020 11:41:50 +0100 Subject: [PATCH] JSON-Payload: Content-Type-Header richtig parsen MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Content-Type kann auch noch Attribute wie »; charset=UTF-8« enthalten. Muss ignoriert werden. --- SL/Request.pm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SL/Request.pm b/SL/Request.pm index 0808bd1da..c33b6b3e5 100644 --- a/SL/Request.pm +++ b/SL/Request.pm @@ -308,7 +308,7 @@ sub read_cgi_input { $target->{$_} = $self->post_data->{$_} for keys %{ $self->post_data }; - } elsif (($ENV{CONTENT_TYPE} // '') eq 'application/json') { + } elsif (($ENV{CONTENT_TYPE} // '') =~ m{^application/json}i) { $self->post_data(_parse_json_formdata($content)); } else { -- 2.20.1