Access-Control-Allow-Methods doesn't seem to be working

233
March 10, 2017, at 04:36 AM

I have a small Web API app up on a web server, with one GET method that returns 3 records, and a POST method that accepts an object and then assigns it an ID and returns the same object.

I'm making ajax calls from a local web app, and testing out my CORS implementation. Almost everything so far, is working well. If I don't specify an Access-Control-Allow-Origin (just set to * for now), my calls are disallowed (what I expect), but I also tried specifying Access-Control-Allow-Methods and it doesn't seem like my input restricts specific calls from being made.

For example, this is what my web.config contains:

<httpProtocol>
  <customHeaders>
    <clear />
    <add name="Access-Control-Allow-Origin" value="*" />
    <add name="Access-Control-Allow-Headers" value="Content-Type, Authorization, Accept, X-Requested-With " />
    <add name="Access-Control-Allow-Methods" value="OPTIONS, GET" />
  </customHeaders>
</httpProtocol>

I only have OPTIONS and GET listed, but I am still able to make POST requests. Likewise, if I set it it "OPTIONS, POST" I am still able to make GET requests.

READ ALSO
Why is .click() and on(&ldquo;click&rdquo;) behaving differently on a bootstrap collapse button?

Why is .click() and on(“click”) behaving differently on a bootstrap collapse button?

I'm trying to add a click event to a a bootstrap button that will do some stuff and then flush the event by returning falseThis means I don't want the bootstrap effect that happens automatically to happen at all

261
How to show certain images for certain values

How to show certain images for certain values

So, I'm making this applicationWhat I basically want to do is to show the current temperature, and then show an image of someone wearing a coat or an image of someone not wearing a coat

202
loop through checkboxes by classname in jquery

loop through checkboxes by classname in jquery

I need to loop through the all checkboxs to set the button disable or notIf one of the checkbox is checked, then the button is enable

277