API client: report redirects to other hosts; keep plain-text error bodies #66

Merged
dario merged 1 commit from dario/redirect-errors into main 2026-11-24 16:07:26 +01:00
Owner

A first Azure DevOps setup failed with "403 forbidden: the bot token
lacks permission", while the real cause was the credential: Azure DevOps
redirected the request to its sign-in page on another host, Go followed
the redirect, and the sandbox proxy blocked that host with a plain-text
403, whose text the client dropped because it was not JSON.

  • apiclient follows redirects only within the API's host (e.g. renamed
    repositories) and reports any other as "redirected to <scheme://host/
    path>", without the query. Backends can classify it (RedirectKind).
  • Azure DevOps classifies a redirect to sign-in as unauthorized, with how
    to make the credential (printf, not echo; no "Basic "; the PAT's
    organization).
  • Error bodies that are plain text, such as a proxy's block notice, are
    now part of the message (shortened, secrets scrubbed); HTML pages are
    still left out.
  • tokens.md and setup.md's troubleshooting name the common mistakes.

Co-Authored-By: Claude Opus 5.5 noreply@anthropic.com

A first Azure DevOps setup failed with "403 forbidden: the bot token lacks permission", while the real cause was the credential: Azure DevOps redirected the request to its sign-in page on another host, Go followed the redirect, and the sandbox proxy blocked that host with a plain-text 403, whose text the client dropped because it was not JSON. - apiclient follows redirects only within the API's host (e.g. renamed repositories) and reports any other as "redirected to <scheme://host/ path>", without the query. Backends can classify it (RedirectKind). - Azure DevOps classifies a redirect to sign-in as unauthorized, with how to make the credential (printf, not echo; no "Basic "; the PAT's organization). - Error bodies that are plain text, such as a proxy's block notice, are now part of the message (shortened, secrets scrubbed); HTML pages are still left out. - tokens.md and setup.md's troubleshooting name the common mistakes. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A first Azure DevOps setup failed with "403 forbidden: the bot token
lacks permission", while the real cause was the credential: Azure DevOps
redirected the request to its sign-in page on another host, Go followed
the redirect, and the sandbox proxy blocked that host with a plain-text
403, whose text the client dropped because it was not JSON.

- apiclient follows redirects only within the API's host (e.g. renamed
  repositories) and reports any other as "redirected to <scheme://host/
  path>", without the query. Backends can classify it (RedirectKind).
- Azure DevOps classifies a redirect to sign-in as unauthorized, with how
  to make the credential (printf, not echo; no "Basic "; the PAT's
  organization).
- Error bodies that are plain text, such as a proxy's block notice, are
  now part of the message (shortened, secrets scrubbed); HTML pages are
  still left out.
- tokens.md and setup.md's troubleshooting name the common mistakes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
dario merged commit 7dfad778d3 into main 2026-11-24 16:07:26 +01:00
dario deleted branch dario/redirect-errors 2026-11-24 16:07:26 +01:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
dario/factory!66
No description provided.