Skip to content

Bug: GetArchiveLink returns a status code 200, not 302, when link is requested with an installation token rather than personal/bearer token #3171

@assembly-winston

Description

@assembly-winston

Inside: func (s *RepositoriesService) GetArchiveLink(ctx context.Context, owner, repo string, archiveformat ArchiveFormat, opts *RepositoryContentGetOptions, maxRedirects int) (*url.URL, *Response, error), it checks for an HTTP code 302:

if resp.StatusCode != http.StatusFound {
    return nil, newResponse(resp), fmt.Errorf("unexpected status code: %s", resp.Status)
}

When testing with curl, it seems the curl calls returns 200 when they are an installation, rather than 302.

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