-
-
Save HenrikFrystykNielsen/6c934be6c6c8fa9e4bc8 to your computer and use it in GitHub Desktop.
Note: this work around is no longer needed. Please see this blog for how to use CORS with Azure Mobile Services: http://azure.microsoft.com/blog/2014/07/28/azure-mobile-services-net-updates/
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
using System.Web.Http; | |
using Microsoft.WindowsAzure.Mobile.Service; | |
namespace henrikntest09Service | |
{ | |
public class MyConfigBuilder : ConfigBuilder | |
{ | |
public MyConfigBuilder(ConfigOptions options) | |
: base(options) | |
{ | |
} | |
protected override void OnComplete(HttpConfiguration config) | |
{ | |
config.EnableCors(); | |
base.OnComplete(config); | |
} | |
} | |
} |
Is EnableCors removed?! Where is it removed from? I can still use it.
I was mistaken the EnableCors is in the CORS nuget package which u need to install.
Hi Henrik. Im doing this, and also setting the rule before my method is call like this:
[EnableCors(origins: "", headers: "", methods: "*")]
I still got a No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'http://localhost:5000' is therefore not allowed access. Can you help me? Thanks in advance
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This no longer pertains as EnableCors() has been removed