jQuery Ajax - POST from Localhost Generates No 'Access-Control-Allow-Origin' header

前端 未结 1 1301
逝去的感伤
逝去的感伤 2021-01-23 19:22

I thought I understood CORS, but there is something I do not understand apparently. I have an app that I am trying to run from localhost. This app needs to POST a request to Azu

1条回答
  •  难免孤独
    2021-01-23 20:07

    Azure Search only allows query operations to be performed via CORS, not management or indexing operations (see MSDN for details on Azure Search support for CORS).

    The reason for this is that browser-based clients need access to the api-key, and sharing an admin key (which is necessary for index write operations) is inherently insecure. For scenarios where the data in an index is supposed to be publicly available, publicly disclosing a query key is ok, but you should never hand an admin API key to a browser-based client.

    0 讨论(0)
提交回复
热议问题