diff --git a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs index c24e6d55ef..c8e72ca895 100644 --- a/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs +++ b/OpenSim/Region/CoreModules/World/Media/Moap/MoapModule.cs @@ -451,11 +451,13 @@ namespace OpenSim.Region.CoreModules.Media.Moap /// /// Check the given url against the given whitelist. /// - /// + /// /// /// true if the url matches an entry on the whitelist, false otherwise - protected bool CheckUrlAgainstWhitelist(string url, string[] whitelist) + protected bool CheckUrlAgainstWhitelist(string rawUrl, string[] whitelist) { + Uri url = new Uri(rawUrl); + foreach (string rawWlUrl in whitelist) { string wlUrl = rawWlUrl; @@ -464,14 +466,13 @@ namespace OpenSim.Region.CoreModules.Media.Moap if (wlUrl.EndsWith("*")) wlUrl = wlUrl.Remove(wlUrl.Length - 1); - if (!wlUrl.StartsWith("http://")) - wlUrl = "http://" + wlUrl; - m_log.DebugFormat("[MOAP]: Checking whitelist URL {0}", wlUrl); + + string urlToMatch = url.Authority + url.AbsolutePath; - if (url.StartsWith(wlUrl)) + if (urlToMatch.StartsWith(wlUrl)) { - m_log.DebugFormat("[MOAP]: Whitelist URL {0} matches {1}", wlUrl, url); + m_log.DebugFormat("[MOAP]: Whitelist URL {0} matches {1}", wlUrl, urlToMatch); return true; } }