Permalink
Browse files

If web requests starts not with URI prefix, redirect to root of the p…

…refix

Before it shown the right result even with wrong path (without prefix),
but it worked only with ZNC directly, not via reverse proxy.

Now it won't work with ZNC directly too.
  • Loading branch information...
1 parent a5cd284 commit 2a656f539d745c04e2cba63dbdabee084ac0ba69 @DarthGandalf DarthGandalf committed Jun 10, 2014
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/HTTPSock.cpp
View
@@ -215,11 +215,11 @@ void CHTTPSock::GetPage() {
DEBUG("Page Request [" << m_sURI << "] ");
// Check that the requested path starts with the prefix. Strip it if so.
- if (!m_sURI.TrimPrefix(m_sURIPrefix)) {
+ if (!m_sURI.TrimPrefix(m_sURIPrefix)) {
DEBUG("INVALID path => Does not start with prefix [" + m_sURIPrefix + "]");
DEBUG("Expected prefix: " << m_sURIPrefix);
DEBUG("Requested path: " << m_sURI);
- Redirect(m_sURI);
+ Redirect("/");
} else {
OnPageRequest(m_sURI);
}

0 comments on commit 2a656f5

Please sign in to comment.