api.instagram CORB 网络错误,因为 jsonp 响应 header with `Content-Type: application/json`

api.instagram CORB network error because of jsonp response header with `Content-Type: application/json`

我正在使用 fetch-jsonp 获取 https://api.instagram.com/oembed/?url=<embedUrl> 以使用 response.html 嵌入我的网站。

但是我的请求遇到了问题 CORB 错误。

这是我的代码片段:

fetchJsonp("https://api.instagram.com/oembed/?url=" + url, {
  timeout: 800,
}).then(function(response) {
  return response.json();
})

我的主机:

Cross-Origin Read Blocking (CORB) blocked cross-origin response https://api.instagram.com/oembed/?url=<embedUrl> with MIME type application/json. See https://www.chromestatus.com/feature/5629709824032768 for more details.

我使用访问 https://api.twitter.com/1/statuses/oembed.json?url=<embedUrl> 的相同截断代码处理来自 Twitter 的嵌入,它工作正常。

因为 Twitter 回复有一个 Content-Type: application/javascript 它有效,但 Instagram 回复有一个 Content-Type: application/json 但它没有。

我怎样才能完成这项工作?

我们遇到了同样的问题,但是从 jsonp 切换到 json 就成功了。例如:

fetch("https://api.instagram.com/oembed/?url=" + url)
  .then(function(response){
    return response.json()
  })
  .then(function(json){
    console.log(json)
  })