Created
June 18, 2020 04:53
-
-
Save amaitland/d7646b2616c1e7e98c18af9aa64ef8d1 to your computer and use it in GitHub Desktop.
AccessControlAllowOriginHeader
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
var resourceStream = executingAssembly.GetManifestResourceStream(resourcePath); | |
var memoryStream = new MemoryStream(); | |
resourceStream.CopyTo(memoryStream); | |
resourceStream.Close(); | |
memoryStream.Position = 0; | |
//Add the Access-Control-Allow-Origin header | |
var resourceHandler = ResourceHandler.FromStream(memoryStream); | |
resourceHandler.Headers.Add("Access-Control-Allow-Origin", "*"); | |
return resourceHandler; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment