-
Notifications
You must be signed in to change notification settings - Fork 94
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
302 Found #98
Comments
Yeah with the default client, it should follow 10 redirects https://pkg.go.dev/net/http#Client, and if this fails should return an error https://cs.opensource.google/go/go/+/refs/tags/go1.20.3:src/net/http/client.go;l=804 Is your client overwriting this behaviour? If there's more than 10 redirects, we should have checked and returned that error. |
No it shouldn't be. I have roughly this import (
"net/http"
"github.com/bradleyfalzon/ghinstallation/v2"
"github.com/google/go-github/v50/github"
)
const (
GHEUrl = "https://my-enterprise-endpoint.com"
ClientId = 1
InstallationId = 2
PKPath = "/path/to/app-private-key.pem"
)
func main() {
transport, _ := ghinstallation.NewKeyFromFile(http.DefaultTransport, ClientId, InstallationId, PKPath)
transport.BaseURL = GHEUrl
httpClient := &http.Client{
Transport: transport,
}
ghClient, _ := github.NewEnterpriseClient(GHEUrl, GHEUrl, httpClient)
// ...
} The default client is just |
Oh it's a redirect to |
I needed to append |
I'm hitting this error message
ghinstallation/transport.go
Line 226 in 97b6ed0
where
resp.Status
is302 Found
Shouldn't this redirect have been followed?
The text was updated successfully, but these errors were encountered: