intercom-node icon indicating copy to clipboard operation
intercom-node copied to clipboard

Requests do not set `Accept` header in Cloudflare Worker environment

Open sbekrin opened this issue 11 months ago • 1 comments

When running in Cloudflare Workers environment, any request to Intercom fails with:

 {
    "code": "media_type_not_acceptable",
    "message": "The Accept header should send a media type of application/json"
  }

It doesn't happen in Node, which I assume is because of different undici fetch implementation. Possible (but noisy) workaround is:

- await intercom.articles.list()
+ await intercom.articles.list({} , { headers: { Accept: "application/json" } })

Versions:

  • intercom-client: 6.0.0
  • wrangler: 3.100.0

sbekrin avatar Jan 08 '25 22:01 sbekrin

Thanks for the issue @sbekrin! Glad that you found a simple workaround for now - we're tracking this on our end and will roll out a fix as soon as we can.

fern-support avatar Jan 12 '25 14:01 fern-support