0

i have a project in which i have enabled CORS

HttpContext.Current.Response.AddHeader("Access-Control-Allow-Origin", "http://localhost:63736");
        HttpContext.Current.Response.AddHeader("Access-Control-Allow-Methods", "POST,GET,DELETE,PATCH,PUT,OPTIONS");
        HttpContext.Current.Response.AddHeader("Access-Control-Allow-Headers", "Content-Type, Authorization, Accept,WWW-Authenticate");

call to .../api/login passed ok using jquery how ever when i am trying to query odata with breeze i get cors error

XMLHttpRequest cannot load http://localhost:53809/odata/Metadata. Origin http://localhost:63736 is not allowed by Access-Control-Allow-Origin. 

how come?

Ting
  • 1,658
  • 16
  • 26
li-raz
  • 1,678
  • 2
  • 29
  • 57

1 Answers1

1

Ward posts some good information on CORS in this post: Using Breeze with a WebApi Service from another domain

Take a look at that first and see if it solves your problem.

Community
  • 1
  • 1
Ting
  • 1,658
  • 16
  • 26