swift-server / swift-server/swift-http-server

`NIOHTTPServer` allows body writes for non-body statuses

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

Nobody has claimed this yet.

kind/enhancement kind/usability
Dominant language
Swift
Stars
44
Forks
13
Avg merge
4d 3h
Merged PRs (30d)
8

Description

The HTTPServer will happily let you write a body to the ResponseWriter for statuses where that is explicitly no allowed like a 204 No Content or any of the 1XX responses. This should probably be disallowed at the server level, either with an error or a precondition

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 at NIOHTTPServer and trace how ResponseWriter handles the response status and body write operation. Check the existing HTTP server tests, then add coverage for 204 and 1XX responses; done means body writes for non-body statuses are rejected consistently at the server level.

Written by the indexing model from the issue text.

Assessment

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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.