Skip to content

Instantly share code, notes, and snippets.

@manuelnelson
Created May 28, 2012 22:53
Show Gist options
  • Save manuelnelson/2821543 to your computer and use it in GitHub Desktop.
Save manuelnelson/2821543 to your computer and use it in GitHub Desktop.
Example of CORS with SharpGs
/// <summary>
/// Sets the Cross Origin Response Object for a given bucket
/// </summary>
/// <param name="bucket"></param>
private void SetCors(IBucket bucket)
{
ICors cors = new Cors();
cors.AddOrigin("http://yourdomainhere.com");
cors.AddMethod("GET");
cors.MaxAge = 1800;
bucket.CorsSave(cors);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment