Page 1 of 1

Generic HTTP plugin - Host-Header

Posted: 04 Apr 2016, 22:52
by JCMB7
Hi,

the HTTP request in Generic HTTP plugin uses the IP address in the sent host-header. This works OK for webservers with only 1 or the default website running.
But with webservers running on shared systems it might not work always.

Example:
Controller Hostname: demo.volkszaehler.org

Request sent is:
GET /middleware.php/data/unique-ID-here.json?operation=add&value=1024 HTTP/1.1\r\n
Host: 5.45.110.30\r\n
Connection: close\r\n

but should be:
GET /middleware.php/data/unique-ID-here.json?operation=add&value=1024 HTTP/1.1\r\n
Host: demo.volkszaehler.org\r\n
Connection: close\r\n

this can be fixed in _C008 by changing line 120 from:
"Host: " + host + "\r\n" +
to:
"Host: " + Settings.ControllerHostName + "\r\n" +

could someone of the developers please change this line?

best regards,
Timo

Re: Generic HTTP plugin - Host-Header

Posted: 14 Apr 2016, 18:58
by JCMB7
could anybody direct my where this minor change could be reported without a fork and pull request in GitHub?

Re: Generic HTTP plugin - Host-Header

Posted: 15 Apr 2016, 17:18
by Martinus
Will be addressed in R101