Skip to content

fix: return safe errors for failed requests - #21

Merged
wjc2821296948 merged 2 commits into
Low-Rate:mainfrom
lijiashu1:fix/safe-http-errors-upstream-main
Oct 20, 2026
Merged

wjc2821296948 merged 2 commits into
Low-Rate:mainfrom
lijiashu1:fix/safe-http-errors-upstream-main

Conversation

@lijiashu1

Copy link
Copy Markdown
Member

Summary

  • Return a clear 400 response for malformed JSON without exposing parser details.
  • Log unexpected server-side request errors and return a generic 500 response instead of misclassifying every failure as a client error.
  • Destroy the response if headers have already been sent, avoiding a second writeHead attempt.
  • Add regression tests for malformed input, unexpected errors, and already-started responses.

Validation

  • Added unit tests for the error-response helper.
  • Automated test suite has not been run in this workflow.

wjc2821296948
wjc2821296948 previously approved these changes Oct 20, 2026
@wjc2821296948

Copy link
Copy Markdown
Member

had conflicts.

auto-merge was automatically disabled October 20, 2026 10:28

Head branch was pushed to by a user without write access

@lijiashu1
lijiashu1 force-pushed the fix/safe-http-errors-upstream-main branch from 3996ed9 to 8815398 Compare October 20, 2026 10:28
@wjc2821296948
wjc2821296948 merged commit 81f2f20 into Low-Rate:main Oct 20, 2026
1 check passed
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.

3 participants