Skip to content

Apps.ListUserRepos may return message "specify a custom media type in the 'Accept' header". #797

Closed

Description

@lingsamuel

When I am trying to use Apps.ListUserRepos, I got message like this:
image

I know this can be fix by adding following accept header:

// in github/github.go line 85~86
// https://developer.github.com/changes/2016-09-14-Integrations-Early-Access/
mediaTypeIntegrationPreview = "application/vnd.github.machine-man-preview+json"

And it can be fix by add following to ListUserRepos function in github/apps_installation.go

req.Header.Set("Accept", mediaTypeIntegrationPreview)

I can provide a PR to fix this.

I noticed that there is a TODO comment in other function says that TODO: remove custom Accept header when this API fully launches., so I will keep this in my fix.

Activity

  1. dmitshur commented on Dec 1, 2017

    @dmitshur
    Member

    Hi, thanks for reporting this.

    I've taken a look at the documentation for that endpoint at https://developer.github.com/v3/apps/installations/#list-repositories-accessible-to-the-user-for-an-installation and was surprised to find that it doesn't mention anything about a custom Accept header there.

    I'd really like to be able to confirm that adding that header is the right fix via documentation.

    After digging further, I found PR #436 which mentioned https://developer.github.com/changes/2016-09-14-Integrations-Early-Access/, which includes:

    image

    So I think that confirms this is the right thing to do.

  2. added a commit that references this issue on Dec 2, 2017
    b527232
  3. added a commit that references this issue on May 1, 2018
    d00d0ab
  4. added a commit that references this issue on Jun 28, 2026
    0e64cb5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions