Skip to content

Requests do not set Accept header in Cloudflare Worker environment #460

@sbekrin

Description

@sbekrin

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions