Commit 52780f6
committed
Fix content-type matching for debug endpoints
The debug endpoints (/api/index/v1/debug/*) return 'application/json'
without the 'charset=UTF-8' parameter, but the generated SDK code was
checking for an exact match with 'application/json; charset=UTF-8'.
This caused the SDK to return 'unknown content-type received' errors
even though the response was valid JSON and the status was 200.
Changed the content-type pattern from 'application/json; charset=UTF-8'
to 'application/json' in:
- Datasource.Status() - /api/index/v1/debug/{datasource}/status
- People.Debug() - /api/index/v1/debug/{datasource}/user
The MatchContentType() function already handles charset parameters
correctly via mime.ParseMediaType(), so this change allows it to
match both 'application/json' and 'application/json; charset=UTF-8'.
Fixes: #841 parent 7d3d235 commit 52780f6
2 files changed
Lines changed: 7 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | 17 | | |
16 | | - | |
17 | 18 | | |
18 | 19 | | |
19 | 20 | | |
| |||
200 | 201 | | |
201 | 202 | | |
202 | 203 | | |
203 | | - | |
| 204 | + | |
204 | 205 | | |
205 | 206 | | |
206 | 207 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
15 | 18 | | |
16 | | - | |
17 | | - | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
212 | | - | |
| 213 | + | |
213 | 214 | | |
214 | 215 | | |
215 | 216 | | |
| |||
0 commit comments