2
0
mirror of https://github.com/fhem/fhem-mirror.git synced 2025-03-03 16:56:54 +00:00

01_FHEMWEB.pm: fix return text for HTTP 405

git-svn-id: https://svn.fhem.de/fhem/trunk@13139 2b470e98-0d58-463d-a4d8-8e2adae1ed80
This commit is contained in:
rudolfkoenig 2017-01-18 10:08:27 +00:00
parent 608b8a9ffd
commit 9d96933e0a

View File

@ -422,9 +422,9 @@ FW_Read($$)
# Return 200 for OPTIONS or 405 for unsupported method
my ($method, $arg, $httpvers) = split(" ", $FW_httpheader[0], 3);
if($method !~ m/^(GET|POST)$/i){
my $retCode = ($method eq "OPTIONS") ? 200 : 405;
my $retCode = ($method eq "OPTIONS") ? "200 OK" : "405 Method Not Allowed";
TcpServer_WriteBlocking($FW_chash,
"HTTP/1.1 $retCode OK\r\n" .
"HTTP/1.1 $retCode\r\n" .
$FW_headerlines.
"Content-Length: 0\r\n\r\n");
delete $hash->{CONTENT_LENGTH};