eidheim / Simple-Web-Server

A very simple, fast, multithreaded, platform independent HTTP and HTTPS server and client library implemented using C++11 and Boost.Asio. Created to be an easy way to make REST resources available from C++ applications.
MIT License
2.61k stars 751 forks source link

Include Port in Host #209

Closed Maufeat closed 6 years ago

Maufeat commented 6 years ago

I had some trouble with sending requests on a new http server, appeared it checks for port in the "Host" Header and would give me 403 when not included.

eidheim commented 6 years ago

Sorry for the late reply, but I noticed that for instance https://slashdot.org does not respond if the host field value is slashdot.org:443. Host field value slashdot.org works though.

So we would have to include the port only if it is non-default.

eidheim commented 6 years ago

I fixed the issue I mentioned in https://github.com/eidheim/Simple-Web-Server/commit/1056bd2e70c6abdd6a334d57247f1ea18bab45ef