[cpp-sp] branch master updated: SSPCPP-828 Use Raw URL as path.
Rod Widdowson
rdw at steadingsoftware.com
Wed Aug 1 10:35:46 EDT 2018
This is an automated email from the git hooks/post-receive script.
rdw pushed a commit to branch master
in repository cpp-sp.
View the commit online:
http://git.shibboleth.net/view/?p=cpp-sp.git;a=commit;h=c43b267f752e1c50318f9c187f6e8690e36ca7a8
The following commit(s) were added to refs/heads/master by this push:
new c43b267 SSPCPP-828 Use Raw URL as path.
c43b267 is described below
commit c43b267f752e1c50318f9c187f6e8690e36ca7a8
Author: Rod Widdowson <rdw at steadingsoftware.com>
AuthorDate: Wed Aug 1 15:32:55 2018 +0100
SSPCPP-828 Use Raw URL as path.
https://issues.shibboleth.net/jira/browse/SSPCPP-828
It turns out that IIS will silently rewrite the script name under out feet,
particularly in the presence of applications (and rewriters).
The URL in the rawHttpRequest appears to do the right thing (being unchanged
for applications, but changed for rewriters). Use tbhis to set our URI
---
iis7_shib/IIS7Request.cpp | 6 +++---
iis7_shib/ShibHttpModule.cpp | 5 ++++-
2 files changed, 7 insertions(+), 4 deletions(-)
diff --git a/iis7_shib/IIS7Request.cpp b/iis7_shib/IIS7Request.cpp
index 553b5fc..cf2f157 100644
--- a/iis7_shib/IIS7Request.cpp
+++ b/iis7_shib/IIS7Request.cpp
@@ -41,11 +41,11 @@ IIS7Request::IIS7Request(IHttpContext *pHttpContext, IHttpEventProvider *pEventP
m_ctx(pHttpContext), m_request(pHttpContext->GetRequest()), m_response(pHttpContext->GetResponse()),
m_firsttime(true), m_port(0), m_gotBody(false), m_event(pEventProvider)
{
- std::wstring_convert<std::codecvt_utf8_utf16<wchar_t>> converter;
- setRequestURI(converter.to_bytes(m_ctx->GetScriptName()).c_str());
-
DWORD len;
PCSTR var;
+
+ setRequestURI(m_request->GetRawHttpRequest()->pRawUrl);
+
bool bSSL = false;
HRESULT hr = m_ctx->GetServerVariable("SERVER_PORT_SECURE", &var, &len);
if (SUCCEEDED(hr)) {
diff --git a/iis7_shib/ShibHttpModule.cpp b/iis7_shib/ShibHttpModule.cpp
index fdc341c..981f942 100644
--- a/iis7_shib/ShibHttpModule.cpp
+++ b/iis7_shib/ShibHttpModule.cpp
@@ -39,7 +39,10 @@ ShibHttpModule::DoHandler(
_In_ IHttpEventProvider * pProvider
)
{
- // Quickly check the URL
+ // Quickly check the URL.
+ // Calling GetScriptName is safe here since we don't care about "visible to other filters" paths, just our path.
+ // This saves us converting from 8 bit ascii up to 16 bit for the compare against something which was only in 16
+ // bits to speed this path. In V4 we can look at the local request
const wstring url(pHttpContext->GetScriptName());
if (url.length() < g_handlerPrefix.length() || !starts_with(url, g_handlerPrefix))
return RQ_NOTIFICATION_CONTINUE;
--
To stop receiving notification emails like this one, please contact
the administrator of this repository.
More information about the commits
mailing list