Commit ebc37c2
fix: normalize api_get/api_post endpoints to prevent leading-slash path issues
The httpx client's base_url includes /api, so leading slashes in
endpoints cause httpx to treat them as absolute paths from the host
root, bypassing the base path. This made api_get("/api/events") 404
and api_get("/events") hit the wrong path.
Added _normalize_endpoint() that strips leading slashes and any
accidental /api/ prefix, so all three forms work identically:
api_get("events"), api_get("/events"), api_get("/api/events")
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 2f5a541 commit ebc37c2
1 file changed
Lines changed: 15 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
93 | 93 | | |
94 | 94 | | |
95 | 95 | | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
96 | 109 | | |
97 | 110 | | |
98 | 111 | | |
99 | 112 | | |
100 | 113 | | |
101 | 114 | | |
102 | 115 | | |
103 | | - | |
| 116 | + | |
104 | 117 | | |
105 | 118 | | |
106 | 119 | | |
| |||
118 | 131 | | |
119 | 132 | | |
120 | 133 | | |
121 | | - | |
| 134 | + | |
122 | 135 | | |
123 | 136 | | |
124 | 137 | | |
| |||
0 commit comments