Skip to content

Commit 19def22

Browse files
authored
Merge pull request #32 from nyanpasudo/master
Removed Mono.Runtime check when checking for WellFormedUri
2 parents de28257 + 95357c2 commit 19def22

File tree

1 file changed

+1
-12
lines changed

1 file changed

+1
-12
lines changed

RedditSharp/WebAgent.cs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -223,24 +223,13 @@ protected virtual void EnforceRateLimit()
223223
public virtual HttpWebRequest CreateRequest(string url, string method)
224224
{
225225
EnforceRateLimit();
226-
bool prependDomain;
227-
// IsWellFormedUristring returns true on Mono for some reason when using a string like "/api/me"
228-
if (Type.GetType("Mono.Runtime") != null)
229-
prependDomain = !url.StartsWith("http://") && !url.StartsWith("https://");
230-
else
231-
prependDomain = !Uri.IsWellFormedUriString(url, UriKind.Absolute);
232-
226+
bool prependDomain = !Uri.IsWellFormedUriString(url, UriKind.Absolute);
233227
HttpWebRequest request;
234228
if (prependDomain)
235229
request = (HttpWebRequest)WebRequest.Create(string.Format("{0}://{1}{2}", Protocol, RootDomain, url));
236230
else
237231
request = (HttpWebRequest)WebRequest.Create(url);
238232
request.CookieContainer = Cookies;
239-
if (Type.GetType("Mono.Runtime") != null)
240-
{
241-
var cookieHeader = Cookies.GetCookieHeader(new Uri("http://reddit.com"));
242-
request.Headers.Set("Cookie", cookieHeader);
243-
}
244233
if (IsOAuth())// use OAuth
245234
{
246235
request.Headers.Set("Authorization", "bearer " + AccessToken);//Must be included in OAuth calls

0 commit comments

Comments
 (0)