Skip to content

Remove/replace references to the "crawler policy" #8649

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

Merged
merged 1 commit into from
May 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions app/templates/data-access.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,7 @@
the
<a href="https://doc.rust-lang.org/cargo/reference/registry-web-api.html">Cargo Web API</a>.
Should you be unable to use one of the previous options, you are welcome to
use the crates.io API provided you abide by the same limits as
<LinkTo @route="policies">the crawling policy</LinkTo>. In summary:
use the crates.io API provided you abide by the following limits:
</p>

<ol>
Expand Down
8 changes: 3 additions & 5 deletions src/middleware/block_traffic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,11 +72,9 @@ fn rejection_response_from(state: &AppState, headers: &HeaderMap) -> Response {

let body = format!(
"We are unable to process your request at this time. \
This usually means that you are in violation of our crawler \
policy (https://{domain_name}/policies#crawlers). \
Please open an issue at https://github.com/rust-lang/crates.io \
or email help@crates.io \
and provide the request id {request_id}"
This usually means that you are in violation of our API data access \
policy (https://{domain_name}/data-access). \
Please email help@crates.io and provide the request id {request_id}"
);

(StatusCode::FORBIDDEN, body).into_response()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
source: src/tests/server.rs
expression: resp.into_json()
expression: resp.json()
---
{
"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 abcd"
"detail": "We are unable to process your request at this time. This usually means that you are in violation of our API data access policy (https://crates.io/data-access). Please email help@crates.io and provide the request id abcd"
}
]
}
4 changes: 2 additions & 2 deletions src/tests/snapshots/all__server__block_traffic_via_ip.snap
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
---
source: src/tests/server.rs
expression: resp.into_json()
expression: resp.json()
---
{
"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 "
"detail": "We are unable to process your request at this time. This usually means that you are in violation of our API data access policy (https://crates.io/data-access). Please email help@crates.io and provide the request id "
}
]
}