mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
* Fix redirect on login for instances On instances where base_url has been set for use behind a reverse proxy, logins are incorrectly redirected. This happens because REQUEST_URI is set by the proxy: 1. librenms has base_url set to http://site.com/nms/ 2. Browser requests http://site.com/nms/ 3. nginx reverse proxies /nms/ to librenms at http://somehost:1234/ 4. librenms sees REQUEST_URI as "/" 5. librenms logs the user in, but sends "Location: /" to the browser. This redirects to the wrong location. To resolve, concatenate REQUEST_URI (which is relative) to base_url. As base_url is slash-terminated, crop the trailing slash. This should have no effect on users with default settings and will correctly redirect instances behind reverse proxies. * I agree to the conditions of the Contributor Agreement contained in doc/General/Contributing.md. * Adding comment explaining redirect logic on login * Use rtrim instead of substr