Skip to content

Commit 511cd69

Browse files
mivertowskiclaude
andcommitted
fix(scripts): add User-Agent header to crates.io API requests
The crates.io API requires a User-Agent header per their data access policy. Without it, requests are rejected with a 403 error. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
1 parent 5e5aee5 commit 511cd69

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scripts/publish.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,8 @@ check_crate_published() {
155155
local crate=$1
156156
local version=$2
157157
# Check if crate version exists on crates.io
158-
local response=$(curl -s "https://crates.io/api/v1/crates/$crate/$version" 2>/dev/null)
158+
# Note: User-Agent header is required by crates.io API policy
159+
local response=$(curl -s -H "User-Agent: rustkernel-publish-script/0.1.0" "https://crates.io/api/v1/crates/$crate/$version" 2>/dev/null)
159160
if echo "$response" | grep -q '"version"'; then
160161
return 0
161162
fi

0 commit comments

Comments
 (0)