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
2017-10-12 16:44:28 +02:00
2018-05-06 15:12:00 -05:00
2018-03-15 19:59:36 +01:00
2018-03-15 19:59:36 +01:00
2018-02-14 12:05:53 +01:00
2018-03-15 19:59:36 +01:00
2016-12-28 09:33:24 +01:00
2016-09-07 08:44:57 -05:00
2016-12-26 16:04:36 +01:00
2017-10-12 16:44:28 +02:00
2018-03-15 19:59:36 +01:00
2018-03-15 19:59:36 +01:00
2018-04-30 19:07:46 +02:00
2016-06-21 06:42:20 -05:00
2018-05-17 20:58:16 +00:00
2018-05-17 20:58:16 +00:00
2016-05-23 13:58:31 +02:00

Habitica Build Status Code Climate Coverage Status Bountysource Open Source Helpers

Greenkeeper badge

Habitica is an open source habit building program which treats your life like a Role Playing Game. Level up as you succeed, lose HP as you fail, earn money to buy weapons and armor.

We need more programmers! Your assistance will be greatly appreciated.

For an introduction to the technologies used and how the software is organized, refer to Guidance for Blacksmiths.

To set up a local install of Habitica for development and testing on various platforms, see Setting up Habitica Locally.

S
Description
A habit tracker app which treats your goals like a Role Playing Game.
Readme 1.8 GiB
Latest
2026-04-09 12:54:31 -05:00
Languages
JavaScript 51.7%
Vue 23.8%
CSS 23.7%
SCSS 0.7%