diff --git a/src/Umbraco.Web/UmbracoModule.cs b/src/Umbraco.Web/UmbracoModule.cs index ebfa604a3d..046ad2fc3d 100644 --- a/src/Umbraco.Web/UmbracoModule.cs +++ b/src/Umbraco.Web/UmbracoModule.cs @@ -51,6 +51,7 @@ namespace Umbraco.Web { // the keepalive service will use that url ApplicationContext.Current.OriginalRequestUrl = string.Format("{0}:{1}{2}", httpContext.Request.ServerVariables["SERVER_NAME"], httpContext.Request.ServerVariables["SERVER_PORT"], IOHelper.ResolveUrl(SystemDirectories.Umbraco)); + LogHelper.Info("Setting OriginalRequestUrl: " + ApplicationContext.Current.OriginalRequestUrl); } // do not process if client-side request diff --git a/src/umbraco.cms/helpers/url.cs b/src/umbraco.cms/helpers/url.cs index 0e344412f7..6518715be3 100644 --- a/src/umbraco.cms/helpers/url.cs +++ b/src/umbraco.cms/helpers/url.cs @@ -50,7 +50,13 @@ namespace umbraco.cms.helpers if (Uri.TryCreate(callerUrl, UriKind.RelativeOrAbsolute, out localUri)) { // check for local urls - if (!requestUri.IsAbsoluteUri || requestUri.Host == localUri.Host) + + //Cannot start with // since that is not a local url + if (!requestUri.OriginalString.StartsWith("//") + //cannot be non-absolute and also contain the char : since that will indicate a protocol + && (!requestUri.IsAbsoluteUri && !requestUri.OriginalString.Contains(":")) + //needs to be non-absolute or the hosts must match the current request + && (!requestUri.IsAbsoluteUri || requestUri.Host == localUri.Host)) { return true; } @@ -61,6 +67,13 @@ namespace umbraco.cms.helpers throw new ArgumentException("CallerUrl is in a wrong format that couldn't be parsed as a valid URI. If you don't want to evaluate for local urls, but just proxy urls then leave callerUrl empty", "callerUrl"); } } + + //we cannot continue if the url is not absolute + if (!requestUri.IsAbsoluteUri) + { + return false; + } + // check for valid proxy urls var feedProxyXml = XmlHelper.OpenAsXmlDocument(IOHelper.MapPath(SystemFiles.FeedProxyConfig)); if (feedProxyXml != null &&