Skip to content

Commit a27c321

Browse files
committed
fix Reddit.GetPost() 403 exception when on oauth
1 parent 2c1ad19 commit a27c321

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

RedditSharp/Reddit.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,9 @@ public JToken GetToken(Uri uri, bool isLive = false)
325325
/// <returns></returns>
326326
public Post GetPost(Uri uri)
327327
{
328+
if (!String.IsNullOrEmpty(WebAgent.AccessToken) && uri.AbsoluteUri.StartsWith("https://www.reddit.com"))
329+
uri = new Uri(uri.AbsoluteUri.Replace("https://www.reddit.com", "https://oauth.reddit.com"));
330+
328331
return new Post().Init(this, GetToken(uri), WebAgent);
329332
}
330333

0 commit comments

Comments
 (0)