0
Fork 0
mirror of https://github.com/TryGhost/Ghost.git synced 2025-02-03 23:00:14 -05:00
ghost/core/server/web/shared/middlewares
Hannah Wolfe 4a67ea5546
Fixed admin host with port causing infinite redirect (#11767)
closes #11766, refs 7284227f1

- when we changed from host to hostname, more changed than just using the x-forwarded-host if trusted because express req.hostname does not return the port
- this causes issues with an infinite redirect if you try to set a different admin host with a port
- added a test to demonstrate the case, that didn't fail due to an error in the test logic
- switched from redirecting based on req.hostname to using req.vhost.host which has the correct trusted, requested value that we should rely on
- simplified the comparison logic to explicitly compare host with host
2020-04-23 19:00:28 +01:00
..
api Moved api cors mw into api app 2020-04-22 07:12:25 +01:00
brute.js Added brute protection to content api (#10343) 2019-01-07 20:03:46 +07:00
cache-control.js Refactored cache-control mw to remove dependencies 2020-04-22 18:01:01 +01:00
custom-redirects.js Swapped common for @tryghost/errors in core/server/web 2020-04-09 19:40:00 +01:00
error-handler.js Swapped common for @tryghost/errors in core/server/web 2020-04-09 19:40:00 +01:00
index.js Moved normalize image mw into api app 2020-04-22 17:48:54 +01:00
labs.js Swapped common for @tryghost/errors in core/server/web 2020-04-09 19:40:00 +01:00
maintenance.js Swapped common for @tryghost/errors in core/server/web 2020-04-09 19:40:00 +01:00
pretty-urls.js
uncapitalise.js Swapped common for @tryghost/errors in core/server/web 2020-04-09 19:40:00 +01:00
url-redirects.js Fixed admin host with port causing infinite redirect (#11767) 2020-04-23 19:00:28 +01:00