Skip to content

Instantly share code, notes, and snippets.

@AdamLJohnson
Created April 25, 2013 23:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • 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