Skip to content

Commit

Permalink
Suppress warning with chunked JSON
Browse files Browse the repository at this point in the history
Content-Type is not set when using Transfer-Encoding, so suppress the warning about an invalid argument string.
  • Loading branch information
rudybrian committed Jul 28, 2020
1 parent 8938a87 commit 403f6db
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/http_server.pl
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,8 @@ sub http_process_request {
#
} elsif ($Http{'Content-Type'} =~ m%^application/(json|x-www-form-urlencoded)%i && $HTTP_BODY =~ /^\{/) {
print "[http_server.pl]: posting json data\n" if $main::Debug{http};
} elsif ($Http{'Transfer-Encoding'} && $HTTP_BODY =~ /^\{/) {
print "[http_server.pl]: posting chunked json data\n" if $main::Debug{http};
} else {
&main::print_log("[http_server.pl]: Warning, invalid argument string detected ($buf) ($Http{'Content-Type'}) ($HTTP_BODY)\n");
}
Expand Down

0 comments on commit 403f6db

Please sign in to comment.