最近同事詢問他將程式中 enable cors 的程式碼(WebApiConfig.cs's Register method) mark 掉,
config.EnableCors(new EnableCorsAttribute("*", "*", "*"));
然後在 web.config 的 customHeaders 加入允許 cors 的設定
但是 client js 在做 preflight request 時,卻會回 405 Method Not Allowed
最近同事詢問他將程式中 enable cors 的程式碼(WebApiConfig.cs's Register method) mark 掉,
config.EnableCors(new EnableCorsAttribute("*", "*", "*"));
然後在 web.config 的 customHeaders 加入允許 cors 的設定
但是 client js 在做 preflight request 時,卻會回 405 Method Not Allowed
最近收到客戶寄來的資安Report,裡面說我們的Web Server允許OPTIONS method。
那要如何關閉它呢?