- Sponsor
-
Notifications
You must be signed in to change notification settings - Fork 44
crates.io API returns 403 #2742
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
Labels
bug
Something isn't working
Comments
🤔 $ curl -o /dev/null -w '%{http_code}\n' -s https://crates.io/api/v1/crates/skim/versions
200
$ curl -o /dev/null -w '%{http_code}\n' -s https://crates.io/api/v1/crates/skim
200 |
I could reproduce the issue. package main
import (
"fmt"
"io"
"log"
"net/http"
"os"
)
func main() {
if err := core(); err != nil {
log.Fatal(err)
}
}
func core() error {
req, err := http.NewRequest("GET", "https://crates.io/api/v1/crates/skim/versions", nil)
if err != nil {
return err
}
resp, err := http.DefaultClient.Do(req)
if err != nil {
return err
}
defer resp.Body.Close()
fmt.Println(resp.StatusCode)
if _, err := io.Copy(os.Stdout, resp.Body); err != nil {
return err
}
return nil
} $ go run .
403
{"errors":[{"detail":"We are unable to process your request at this time. This usually means that you are in violation of our crawler policy (https://crates.io/policies#crawlers). Please open an issue at https://github.com/rust-lang/crates.io or email help@crates.io and provide the request id 768e05d9-4654-4cd8-96ce-951261259c20"}]}
|
req.Header.Add("User-Agent", "aqua") I could resolve the issue by setting a User-Agent header. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
aqua info
Overview
aqua g
,aqua gr
, andaqua up
commands don't work well forcargo
package because crates.io API returns 3xx.https://aquaproj.github.io/docs/reference/registry-config/cargo-package/
How to reproduce
Debug output
No response
Expected behaviour
These commands succeed.
Actual behaviour
Note
aquaproj/aqua-registry#20854 (comment)
aqua/pkg/cargo/versions.go
Line 41 in 90b5cc2
aqua/pkg/cargo/versions.go
Line 54 in 90b5cc2
aqua/pkg/cargo/versions.go
Lines 88 to 90 in 90b5cc2
The text was updated successfully, but these errors were encountered: