Skip to content

Instantly share code, notes, and snippets.

@AdamLJohnson
Created April 25, 2013 23:14
Show Gist options
  • Save AdamLJohnson/5464014 to your computer and use it in GitHub Desktop.
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/
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