blob: 6fafc86b4cccd6016b07cca89596c080e7593006 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
|
using System;
using Uri = MonoForks.System.Uri;
namespace CrossDomainPolicyParser
{
class UriTools
{
public static Uri MakeUri(string gameurl, string url)
{
if ((!url.ToLower().StartsWith("http://")) && (!url.ToLower().StartsWith("https://")) && (!url.ToLower().StartsWith("file://")))
url = GetBaseUrl(gameurl) + "/" +url;
Log.Msg("About to parse url: " + url);
return new Uri(url);
}
static string GetBaseUrl(string url)
{
return url.Substring(0, url.LastIndexOf('/'));
}
}
}
|