Reading response headers with Fetch API

后端 未结 6 1613
Happy的楠姐
Happy的楠姐 2020-11-28 06:42

I\'m in a Google Chrome extension with permissions for \"*://*/*\" and I\'m trying to make the switch from XMLHttpRequest to the Fetch API.

The extensio

6条回答
  •  栀梦
    栀梦 (楼主)
    2020-11-28 07:00

    For us to fix this restriction issue, adding exposed header names is good enough.

    access-control-expose-headers: headername1, headername2, ...

    After setting this header, the client side script is able to read those headers (headername1, headername2, ...) from the response.

提交回复
热议问题