MAMP Bad Request 400 after upgrading to 4.2.1

After updating MAMP to the latest version (4.2.1 at the time of writing), when I visit any virtual host URL, I get Bad Request error. I noticed that it is only happening to the domains with my custom development TLD (.2u).

I changed Apache Log level to debug, and got the following lines:
[Wed Dec 13 10:15:48 2017] [debug] vhost.c(791): [client 127.0.0.1] [strict] Invalid host name 'dash.2u', problem near: .2u
[Wed Dec 13 10:15:48 2017] [debug] vhost.c(886): [client 127.0.0.1] Client sent malformed Host header: dash.2u
[Wed Dec 13 10:15:48 2017] [debug] protocol.c(1369): [client 127.0.0.1] client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23): /

Searching the web, found it is related to HttpProtocolOptions directive. Apache will be strict checking request headers, for my case, the TLD was invalid.

I tried to add HttpProtocolOptions Unsafe, but it didn’t help, probably because of  this bug affecting the Apache/2.2.32 that MAMP provides.

The last solution was to change my development TLD to .dv and now everything is working fine.

Wesam Alalem

Web Developer, from Tripoli - Libya.

Leave a Reply

Your email address will not be published.