Files
habitica/website/server/middlewares
aszlig 79087b27d3 redirects: Fix parsing BASE_URL with port number (#10350)
The parsing in the redirects module was simply determining the base host
via trimming off everything up to //, so a BASE_URL like
"http://localhost:3000" will result in the host name "localhost:3000",
which isn't a valid host name.

So the problem here is that BASE_URL_HOST is used for determining
whether the client should be redirected and it's comparing the hostname
of the request object with BASE_URL_HOST.

For example if we have the aforementioned BASE_URL, we get to the
following comparison:

req.hostname !== BASE_URL_HOST

Which expands to:

"localhost" !== "localhost:3000"

So in order to get rid of the port number, we now use url.parse() to get
the right host name.

Signed-off-by: aszlig <aszlig@nix.build>
2018-05-18 17:02:36 +02:00
..
2018-04-30 17:36:41 +02:00
2018-03-15 19:59:36 +01:00
2018-02-02 16:37:36 +01:00
2018-02-04 14:39:46 +01:00
2018-02-04 13:28:05 +01:00
2017-11-07 20:34:52 +01:00
2016-12-20 22:31:36 +01:00
2016-12-20 22:31:36 +01:00
2018-02-04 14:39:46 +01:00