QuinnDamerell / Baconit

A beatiful, powerful, reddit client for Windows 10.
https://www.reddit.com/r/BaconitDev/
GNU General Public License v2.0
242 stars 81 forks source link

To avoid issues with HTML-encoded strings, request the raw JSON form of results from the Reddit API. #73

Closed ben-zen closed 8 years ago

ben-zen commented 8 years ago

This PR intends to address issue #72 by changing how Baconit accesses the Reddit APIs.

Previously, requests were presented in an HTML-encoded form. To address this, calls to decode those encoded strings were sprinkled throughout the sources, but URLs were never decoded. This had the unfortunate side effect of breaking a great many sites, including any images hosted on Reddit's own new image uploading service. To address this issue, this change modifies all calls made to the Reddit API to use raw JSON, instead of HTML-encoded responses received, and also removes the previously-required calls to decode strings that would have been unnecessarily encoded.

dreamlayers commented 8 years ago

Thank you for addressing #72. I feel this is the right approach, and better than just adding post.Url = WebUtility.HtmlDecode(post.Url); However, this changes RedditListHelper, which is used in other places, often via InitListHelper(). HTML decoding for other things loaded via RedditListHelper needs to be removed, for example in SearchPostCollector.cs

QuinnDamerell commented 8 years ago

Thanks so much for the investigation and the fix! I have merged this into develop and I will test it for a little while. :)