Closed mcaulifn closed 3 years ago
For Enterprise Server we recommend using @octokit/core
with the @octokit/plugin-enterprise-server
plugin. Using it will set the appropriate headers required for the respective version.
You can also explicitly set a preview header by passing { ..., mediaType: { previews: ['antiope'] } }
to the options.
If you want to support both api.github.com and supported GitHub Enterprise Server versions, you could use https://github.com/octokit/plugin-enterprise-compatibility.js, but we would need to add the feature to add the antiope
preview to the respective requests. If you want to send a pull request I'd be happy to review it.
By removing @octokit/types@6.1.1
and reverting to @octokit/rest@18.0.9
, this same call works as expected.
I am not in a position to create a PR for that feature.
I think adding the mediaType
parameter is the better workaround compared to pinning outdated versions of @ocotkit/*
libraries. But I'm glad you got it unblocked
@gr2m thanks for the hint of the media type. And fully agree, I don't like to stick to an old version.
Checklist
Environment
Versions
What happened?
Minimal test case to reproduce the problem
Request object from error:
What did you expect to happen?
Octokit to insert necessary headers.
What the problem might be
Possibly introduced with https://github.com/octokit/rest.js/pull/1952. Similar to https://github.com/octokit/rest.js/issues/861