fix: targeted trailing slashes for POST endpoints (hotfix) #74

Merged
cal merged 1 commits from fix/trailing-slash-307-redirect into main 2026-03-09 22:52:30 +00:00
Owner

Summary

  • Reverts universal trailing slash in _build_url which broke custom_commands/by_name/{name}/execute endpoints (401 auth errors)
  • Adds trailing slashes only to the two batch POST endpoints (plays/, decisions/) that need them to prevent 307 redirects from dropping request bodies
  • Fixes test mock URLs to match non-trailing-slash URL building

Context

The original fix (commit 9379ba5) added universal trailing slashes to all API URLs to fix 307 redirects dropping POST bodies on /plays and /decisions. This broke the /cc custom command because custom_commands/by_name/{name}/execute/ returns 401.

The targeted approach only adds trailing slashes where actually needed.

Test plan

  • All 930 tests pass (25 API client tests, 905 others)
  • Verified _build_url produces URLs without trailing slashes (won't break custom commands)
  • plays/ and decisions/ POST calls use trailing slashes (prevents 307 redirect body loss)

🤖 Generated with Claude Code

## Summary - Reverts universal trailing slash in `_build_url` which broke `custom_commands/by_name/{name}/execute` endpoints (401 auth errors) - Adds trailing slashes only to the two batch POST endpoints (`plays/`, `decisions/`) that need them to prevent 307 redirects from dropping request bodies - Fixes test mock URLs to match non-trailing-slash URL building ## Context The original fix (commit 9379ba5) added universal trailing slashes to all API URLs to fix 307 redirects dropping POST bodies on `/plays` and `/decisions`. This broke the `/cc` custom command because `custom_commands/by_name/{name}/execute/` returns 401. The targeted approach only adds trailing slashes where actually needed. ## Test plan - [x] All 930 tests pass (25 API client tests, 905 others) - [x] Verified `_build_url` produces URLs without trailing slashes (won't break custom commands) - [x] `plays/` and `decisions/` POST calls use trailing slashes (prevents 307 redirect body loss) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
cal added 1 commit 2026-03-09 22:51:17 +00:00
fix: use targeted trailing slashes instead of universal (hotfix)
All checks were successful
Build Docker Image / build (pull_request) Successful in 1m7s
f6a25aa16d
Reverts universal trailing slash in _build_url which broke custom_commands
endpoints (401 on /execute/). Instead, add trailing slashes only to the
two batch POST endpoints (plays/, decisions/) that need them to avoid
307 redirects dropping request bodies.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
cal merged commit 269429254f into main 2026-03-09 22:52:30 +00:00
cal deleted branch fix/trailing-slash-307-redirect 2026-03-09 22:52:30 +00:00
Sign in to join this conversation.
No reviewers
No Milestone
No project
No Assignees
1 Participants
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: cal/major-domo-v2#74
No description provided.