Created
May 28, 2012 22:53
-
-
Save manuelnelson/2821543 to your computer and use it in GitHub Desktop.
Example of CORS with SharpGs
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
/// <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