Skip to content

Commit

Permalink
Merge pull request #777 from tobser/prevent_warning_with_echo
Browse files Browse the repository at this point in the history
prevent warning with alexa/echo
  • Loading branch information
hplato authored May 22, 2019
2 parents e78e59b + 1000256 commit d188b2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/http_server.pl
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,11 @@ sub http_process_request {
# For this reason we use a regular expresion here instead of
# checking for "application/json" using the "eq" operator.
#
} elsif ($Http{'Content-Type'} =~ m%^application/json%i && $HTTP_BODY =~ /^\{/) {
# alex/echo sends
# Content-type: application/x-www-form-urlencoded
# with a json body
#
} 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};
} 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 d188b2e

Please sign in to comment.