dresden-elektronik / phoscon-app-beta

Access to Phoscon app beta
79 stars 5 forks source link

Phoscon web server reports illegally formatted Content-Length: header #383

Closed emeidi closed 3 years ago

emeidi commented 3 years ago

I started using monit to check that the Phoscon web app is running and responding to HTTP requests. monit check configuration:

check host phoscon.domain.tld with address 10.1.2.3
    if failed port 9000 protocol http for 10 cycles then alert

(Please note: I run Phoscon on port 9000 because the default port already is taken)

The monit log is now full of such errors:

[2021-05-13T13:43:34+0200] error : 'phoscon.domain.tld' failed protocol test [HTTP] at [10.1.2.3]:9000 [TCP/IP] -- HTTP error: Illegal Content-Length response header 'Content-Length:30172'

When looking at monit's source code (line 246) one can see monit expects a space between Content-Length: and 30172. Ie.

Content-Length spec in RFC 2616 does not explicitly mention a space (or I am not good at reading/understanding the spec), but the RFC example does feature a space.

Thanks for looking into this! Best, M.

manup commented 3 years ago

Hi, with which deCONZ version is the error reported? There was a fix in version v2.11.1-beta https://github.com/dresden-elektronik/deconz-rest-plugin/pull/4789

emeidi commented 3 years ago

Ooops, sorry, didn't notice this fix, my bad. I am indeed running 2.10.04-debian-buster-stable. Looks like this should be fixed in the BETA then.

manup commented 3 years ago

Yes should be fixed there, short test with curl:


$ curl -i http://127.0.0.1:8080/api/1234567
HTTP/1.1 200 OK
Access-Control-Allow-Origin: *
Content-Type: application/json; charset=utf-8
Content-Length: 15842
ETag:"6bd2c8854d1c86354047f3063098d3da"