Commit f9f875b
refactor(proxy): use httputil.WriteJSONResponse for filtered/empty JSON writes
Two sites in handler.go manually set Content-Type, called WriteHeader, and
wrote raw bytes instead of using the project's httputil.WriteJSONResponse
helper that is already used elsewhere in the same file.
- handleWithDIFC: replace 3-line manual block with WriteJSONResponse +
json.RawMessage(filteredJSON) to preserve pre-serialized bytes as-is
- writeEmptyResponse: restructure to determine empty string before calling
WriteJSONResponse + json.RawMessage(empty)
Closes #3312
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 46495a3 commit f9f875b
1 file changed
Lines changed: 2 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
327 | 327 | | |
328 | 328 | | |
329 | 329 | | |
330 | | - | |
331 | | - | |
332 | | - | |
| 330 | + | |
333 | 331 | | |
334 | 332 | | |
335 | 333 | | |
| |||
364 | 362 | | |
365 | 363 | | |
366 | 364 | | |
367 | | - | |
368 | | - | |
369 | 365 | | |
370 | 366 | | |
371 | 367 | | |
| |||
381 | 377 | | |
382 | 378 | | |
383 | 379 | | |
384 | | - | |
| 380 | + | |
385 | 381 | | |
386 | 382 | | |
387 | 383 | | |
| |||
0 commit comments