Created
April 25, 2013 23:14
-
-
Save AdamLJohnson/5464014 to your computer and use it in GitHub Desktop.
Create a proxy action to help with handling cross site scripting issues. Got the idea from: http://encosia.com/use-asp-nets-httphandler-to-bridge-the-cross-domain-gap/
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public void proxy(string url) | |
{ | |
WebClient wc = new WebClient(); | |
string baseUrl = url; | |
string response = wc.DownloadString(baseUrl); | |
HttpContext.Response.ContentType = "application/json"; | |
HttpContext.Response.Write(response); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment