Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix redirect on login for instances behind reverse proxies #6371

Merged
merged 4 commits into from Apr 6, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 1 addition & 0 deletions AUTHORS.md
Expand Up @@ -196,6 +196,7 @@ LibreNMS contributors:
- Deeps (deepseth)
- Jari Schäfer <jari.schaefer@gmail.com> (jarischaefer)
- Jan-Philipp Litza <janphilipp@litza.de> (jplitza)
- Chris Putnam <chrisputnam@gmail.com> (putnam)

Observium was written by:
- Adam Armstrong
Expand Down
3 changes: 2 additions & 1 deletion html/includes/authenticate.inc.php
Expand Up @@ -96,7 +96,8 @@

$permissions = permissions_cache($_SESSION['user_id']);
if (isset($_POST['username'])) {
header('Location: '.$_SERVER['REQUEST_URI'] ?: $config['base_url'], true, 303);
// Trim the trailing slash off of base_url and concatenate the (relative) REQUEST_URI
header('Location: '.rtrim($config['base_url'], '/').$_SERVER['REQUEST_URI'], true, 303);
exit;
}
} elseif (isset($_SESSION['username'])) {
Expand Down