Skip to content
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

server returned 403 Forbidden #104

Open
Prateeknandle opened this issue Sep 8, 2023 · 1 comment
Open

server returned 403 Forbidden #104

Prateeknandle opened this issue Sep 8, 2023 · 1 comment

Comments

@Prateeknandle
Copy link

Prateeknandle commented Sep 8, 2023

resp, err := grab.Get(".", "some-zip-file")
	if err != nil {
		log.Info(err)
	}

This gives the error server returned 403 Forbidden
Try with https://github.com/cavaliergopher/grab/archive/refs/tags/v3.0.1.zip, it'll show you the error

@cfergeau
Copy link

cfergeau commented Sep 12, 2023

I've only seen this happen on downloads from github, and it's caused by the default user agent (which is "grab"), not sure why it's blocked. Changing it to anything else solves this issue.
In your example, this can be achieved by adding grab.DefaultClient.UserAgent="non-default-user-agent" before the call to grab.Get

tyzbit added a commit to tyzbit/AuroraBoot that referenced this issue Sep 29, 2023
cavaliergopher/grab#104

The default UserAgent for grab is "grab" and it appears GitHub is blocking it, at least in some cases.

You'll get log lines like this:

7 errors occurred:
	* server returned 403 Forbidden
tyzbit added a commit to tyzbit/AuroraBoot that referenced this issue Sep 29, 2023
cavaliergopher/grab#104

The default UserAgent for grab is "grab" and it appears GitHub is blocking it, at least in some cases.

You'll get log lines like this:

7 errors occurred:
	* server returned 403 Forbidden

Signed-off-by: tyzbit <[email protected]>
mudler pushed a commit to kairos-io/AuroraBoot that referenced this issue Sep 29, 2023
cavaliergopher/grab#104

The default UserAgent for grab is "grab" and it appears GitHub is blocking it, at least in some cases.

You'll get log lines like this:

7 errors occurred:
	* server returned 403 Forbidden

Signed-off-by: tyzbit <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants