0

I have several devices with a tiny http client on them. We tested them with my custom webserver and all is good. Now I want to migrate to apache as my webserver, and my requests are getting shut down:

client sent HTTP/1.1 request without hostname (see RFC2616 section 14.23)

I know this error occurs because I'm missing the "Host: www.blah.com" entry in my header. It's required per HTTP 1.1 spec

RFC2616 section 14.23 http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html

The issue is I cannot change the firmware on the hardware, so the http client is what it is. If I were familiar with this requirement before hand, I would have implemented it. My question is:

How can I configure apache (I think the authz_host module ) to allow requests with no Host: entry in their header?

Dashoveler
  • 37
  • 3
  • Similar to [Can Tomcat accept HTTP 1.1 requests without a Host header?](http://stackoverflow.com/questions/12808451/can-tomcat-accept-http-1-1-requests-without-a-host-header). – Joe Feb 18 '15 at 11:41

1 Answers1

0

The direct answer is that I do not think you can make apache ignore the protocol. Your clients are broken. However, thinking outside the box a bit, if all else fails, perhaps you could write a small http proxy in python which does nothing but fix your http requests and send them on to the proper host and tell your clients to use the proxy.

Rich
  • 926
  • 8
  • 17
  • Ya, I was thinking about writing an app to fix and redirect the request. More than likely I would just adjust the client to use a different port, which I can configure on them through a settings file. Then create a service to fix and redirect to the apache port – Dashoveler Feb 18 '15 at 05:16
  • If my comment is useful, consider upvoting me. ;-) – Rich Feb 18 '15 at 14:53
  • It appears I can't unless my rep is >= 15 – Dashoveler Feb 18 '15 at 17:11
  • Wow you cannot vote for my answer? Oh, well, I hope you get an answer you can "accept" then. – Rich Feb 19 '15 at 05:00
  • Aha, thanks for accepting my answer. Hope that workaround works for you. – Rich Feb 22 '15 at 18:57
  • I managed to convince the team to do another round of testing with the new code, this time with a Host entry! Sticking to specs does wonders – Dashoveler Feb 23 '15 at 19:16