Skip to content

fix: add Authorization header to Histories, CreateHistory, and Delete#4

Open
RyanGWU82 wants to merge 1 commit into
arthursoares:mainfrom
RyanGWU82:fix/histories-auth
Open

fix: add Authorization header to Histories, CreateHistory, and Delete#4
RyanGWU82 wants to merge 1 commit into
arthursoares:mainfrom
RyanGWU82:fix/histories-auth

Conversation

@RyanGWU82

Copy link
Copy Markdown

While using this SDK in my own project, I found that Histories() always returns a 404 error. The root cause is that three methods on the account history endpoints make authenticated API calls without setting the Authorization header.

The Things Cloud server returns HTTP 404 (not 401) for unauthenticated requests to these endpoints, so the failure gives no hint that auth is the problem.

Affected methods:

  • Client.Histories() — GET /own-history-keys
  • Client.CreateHistory() — POST /own-history-keys
  • History.Delete() — DELETE /own-history-keys/:id

All three now set Authorization: Password <password>, matching the pattern already used in Verify().

Tests are extended to assert the header is present on each request.

These three methods were making authenticated API calls without setting
the Authorization header, causing the server to return 404. The fix
follows the existing pattern used in Verify() and the account management
methods.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

1 participant