rejetto forum

Bug (2.3d): HTTP responses are not standards compliant

gork · 3 · 2567

0 Members and 1 Guest are viewing this topic.

Offline gork

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
Hello,

I have discovered when putting HFS behind a proxy that many of its HTTP responses are not standards compliant. HFS is unusable behind such a system.

HTTP 1.1 requires a header which will allow the client to determine the end of the response. In error pages and during redirects, HFS lacks this header. Some proxies give 502 BAD_GATEWAY errors when this occurs.

This header may be one of:

Content-Length: <valid # of bytes, can be 0>

Transfer-Encoding: chunked

Connection: close

This last option is what HFS is usually doing when it sends error or redirect pages since it seems to simply close the connection following the response. Browsers are generally tolerant of this where many proxies, load balancers, and web application firewalls are not.

I can work around the error with {.add header|Connection: close.} in [error-page] in the template but I cannot work around the redirect issue in the template. I do not believe HFS uses chunked transfers at all so the second option shouldn't ever be needed. Depending on how the persistent connections option works, Content-length: 0 may be needed during redirects or when returning error pages also.

Thanks for a nice little utility!


Offline rejetto

  • Administrator
  • Tireless poster
  • *****
    • Posts: 13510
    • View Profile
i'm sorry, i will work on it.
I expect next update to include it but there's no ETA.


Offline gork

  • Occasional poster
  • *
    • Posts: 2
    • View Profile
No need to apologize! I am happy to help track down the problem. Thanks for the fast response.

In the meantime I am running HFS behind stunnel which does not care about the underlying protocol.