Skip to content

Instantly share code, notes, and snippets.

@jz5
Created June 4, 2014 12:50
Show Gist options
  • Save jz5/722651c53465d5354059 to your computer and use it in GitHub Desktop.
Save jz5/722651c53465d5354059 to your computer and use it in GitHub Desktop.
Public Class AllowCrossSiteJsonAttribute
Inherits System.Web.Http.Filters.ActionFilterAttribute
Public Overrides Sub OnActionExecuted(actionExecutedContext As Http.Filters.HttpActionExecutedContext)
If actionExecutedContext.Request IsNot Nothing Then
actionExecutedContext.Response.Headers.Add("Access-Control-Allow-Origin", "*")
End If
MyBase.OnActionExecuted(actionExecutedContext)
End Sub
End Class
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment