swift-server / swift-server/async-http-client

HTTPBin ignores all channel errors on the server side

Open
#250 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

kind/enhancement
Dominant language
Swift
Stars
1.1k
Forks
156
PR merge metrics
No merged PRs in 30d

Description

Right now, the HTTPBin ignores all channel errors on the server side.

That's bad for multiple reasons:

  • most servers that encounter protocol errors from the client just close the connection
  • we can't make sure the server is happy

I think the default behaviour of HTTPBin should be that it runs an XCTFail("server error") and closes the connection. However for tests that expect server failures, this should be configurable.

Fixing this issue means:

  • having HTTPBin have a configuration property(?) that can change the behaviour
  • making HTTPBinHandler implement func errorCaught.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating HTTPBin and HTTPBinHandler, then inspect how channel errors are currently handled or ignored. Add configurable behavior so the default fails with XCTFail("server error") and closes the connection, while tests expecting server failures can opt out; verify the relevant HTTPBin tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
swift
Domain
testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
52/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.