sta / sta/websocket-sharp

HttpServer cannot listen to post when sending content-length is zero

Open
#633 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.1k
Forks
1.7k
PR merge metrics
No merged PRs in 30d

Description

My post data is below
POST https://127.0.0.1:39091/init HTTP/1.1
Host: 127.0.0.1:39091
Connection: keep-alive
Content-Length: 0
Accept: application/json, text/javascript, /; q=0.01
DNT: 1
User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/85.0.4183.121 Safari/537.36

Response is below.
HTTP/1.1 411 Length Required
Content-Type: text/html; charset=utf-8
Server: websocket-sharp/1.0
Date: Sat, 10 Oct 2020 09:39:42 GMT
Content-Length: 54
Connection: close

411 Length Required

So I reckon that HttpServer is not listening for zero content-length of post.
How can I fix this issue?

Contributor guide

No contributing guide indexed for this repository

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 the HttpServer handling of the provided POST request and reproduce the response with Content-Length: 0. Trace why this request returns 411 Length Required, then verify that the zero-length POST is accepted without breaking other HTTP requests.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
backend, networking
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.