Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Use absolute URIs in Redirect

Although most browsers seem to accept relative redirects, it is not
allowed by HTTP/1.1.

This commit changes relative URIs to absolute ones when redirecting.
  • Loading branch information...
commit 46975cd9f13fa9ca396253257cd9ef030d948d30 1 parent 4376b37
@uu1101 uu1101 authored
Showing with 8 additions and 8 deletions.
  1. +8 −8 modules/webadmin.cpp
View
16 modules/webadmin.cpp
@@ -543,7 +543,7 @@ class CWebAdminMod : public CModule {
WebSock.PrintErrorPage("Please don't delete yourself, suicide is not the answer!");
return true;
} else if (CZNC::Get().DeleteUser(sUser)) {
- WebSock.Redirect("listusers");
+ WebSock.Redirect(GetWebPath() + "listusers");
return true;
}
@@ -711,7 +711,7 @@ class CWebAdminMod : public CModule {
return true;
}
- WebSock.Redirect("editnetwork?user=" + pUser->GetUserName().Escape_n(CString::EURL) + "&network=" + pNetwork->GetName().Escape_n(CString::EURL));
+ WebSock.Redirect(GetWebPath() + "editnetwork?user=" + pUser->GetUserName().Escape_n(CString::EURL) + "&network=" + pNetwork->GetName().Escape_n(CString::EURL));
return true;
}
@@ -985,7 +985,7 @@ class CWebAdminMod : public CModule {
return true;
}
- WebSock.Redirect("edituser?user=" + pUser->GetUserName().Escape_n(CString::EURL));
+ WebSock.Redirect(GetWebPath() + "edituser?user=" + pUser->GetUserName().Escape_n(CString::EURL));
return true;
}
@@ -1021,7 +1021,7 @@ class CWebAdminMod : public CModule {
return true;
}
- WebSock.Redirect("edituser?user=" + pUser->GetUserName().Escape_n(CString::EURL));
+ WebSock.Redirect(GetWebPath() + "edituser?user=" + pUser->GetUserName().Escape_n(CString::EURL));
return false;
}
@@ -1041,7 +1041,7 @@ class CWebAdminMod : public CModule {
return true;
}
- WebSock.Redirect("editnetwork?user=" + pNetwork->GetUser()->GetUserName().Escape_n(CString::EURL) + "&network=" + pNetwork->GetName().Escape_n(CString::EURL));
+ WebSock.Redirect(GetWebPath() + "editnetwork?user=" + pNetwork->GetUser()->GetUserName().Escape_n(CString::EURL) + "&network=" + pNetwork->GetName().Escape_n(CString::EURL));
return false;
}
@@ -1321,9 +1321,9 @@ class CWebAdminMod : public CModule {
}
if (!spSession->IsAdmin()) {
- WebSock.Redirect("edituser");
+ WebSock.Redirect(GetWebPath() + "edituser");
} else {
- WebSock.Redirect("listusers");
+ WebSock.Redirect(GetWebPath() + "listusers");
}
/* we don't want the template to be printed while we redirect */
@@ -1692,7 +1692,7 @@ class CWebAdminMod : public CModule {
WebSock.GetSession()->AddError("Settings changed, but config was not written");
}
- WebSock.Redirect("settings");
+ WebSock.Redirect(GetWebPath() + "settings");
/* we don't want the template to be printed while we redirect */
return false;
}
Please sign in to comment.
Something went wrong with that request. Please try again.