I'm running into an issue when using Go's http client to download a zip or tar.gz file from Github. I get a 403 with the message "Your access to this site has been restricted".
Curl works fine though.
I am running this in an EC2 instance on AWS in the us-west-2 region. In particular,
Ubuntu Server 16.04 LTS (HVM), SSD Volume Type - ami-0807918df10edc141 (64-bit x86) / ami-0c75fb2e6a6be38f6 (64-bit Arm)
Info
Sample code to reproduce:
package main
import (
"fmt"
"io/ioutil"
"net/http"
)
func main() {
endpoint := "https://github.com/kubeflow/manifests/archive/v1.0.2.tar.gz"
// or https://api.github.com/repos/kubeflow/manifests/zipball/v0.12.0
// Get the data
resp, err := http.Get(endpoint)
if err != nil {
fmt.Printf("[error] %v", err)
return
}
defer resp.Body.Close()
respData, err := ioutil.ReadAll(resp.Body)
if err != nil {
fmt.Printf("[error] %v", err)
return
}
// Returns a 403 and html error page
fmt.Printf("Resp:\n%v\n", string(respData))
}
Note: the above works fine on my local machine, it just seems to stop in the aws instance.
Thanks!
I had a similar problem: "Access to this site has been restricted..."
I solved this by updating my IDE (IntelliJ IDEA) and git version. You can do this all directly in IntelliJ IDEA.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With