Forum

HTTP_HOST should contain port number

Paul
19 January 2014, 21:17
Hi,

I believe that HTTP_HOST should contain the port number. Previously you wrote, "It looks like Apache got the HTTP_HOST wrong. It should not contain the port number" in this thread: http://www.hiawatha-webserver.org/forum/topic/119 However, according to the PHP documentation (http://www.php.net/manual/en/reserved.variables.server.php) HTTP_HOST should contain the "host" header from the request. With Hiawatha running on port 8080 I verified through Firebug that the host header in my request contained the port number, yet HTTP_HOST (returned from PHP's $_SERVER variable) had only the IP address. I couldn't find any documentation supporting the idea that HTTP_HOST should not contain the port number.

Unfortunately, the missing port number breaks an app I need to use so I had to replace Hiawatha with Nginx. On my way out the door I thought I'd leave this suggestion. Even if you reject it perhaps this message will save someone else the hours I spent trying to track down why an app (Multicraft which runs on the Yii framework) kept redirecting back to port 80 after every POST.

Paul

Hiawatha version: 9.3
Operating System: Ubuntu 12.04 LTS
Hugo Leisink
19 January 2014, 22:47
I will change this for you in 9.4.
Paul
20 January 2014, 02:14
Wow...you're amazing, responding only 90 minutes after I posted. There's no other software I know of with support like Hiawatha's! I'll gladly give 9.4 a go...thanks!

Paul

This topic has been closed.