HTTPProxyServer should not send Content-Length header in successful responses to CONNECT requests
Nobody has claimed this yet.
Assessment
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Newbie friendliness
- 48/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- ruby
- Domain
- networking
Research direction
Start by running the WEBrick::HTTPProxyServer example and the provided curl command to reproduce the header. Then trace the HTTPProxyServer handling of CONNECT responses. Done means successful 2xx CONNECT responses no longer include Content-Length or Transfer-Encoding, consistent with RFC7231.
Written by the indexing model from the issue text.
Description
According to RFC7231,
A server MUST NOT send any Transfer-Encoding or Content-Length header fields in a 2xx (Successful) response to CONNECT.
However, I tried the example code on https://docs.ruby-lang.org/en/2.2.0/WEBrick/HTTPProxyServer.html
require 'webrick'
require 'webrick/httpproxy'
proxy = WEBrick::HTTPProxyServer.new Port: 8000
trap 'INT' do proxy.shutdown end
trap 'TERM' do proxy.shutdown end
proxy.start
and sent a request through this proxy
$ ALL_PROXY=http://localhost:8000 curl -I https://www.google.com/
and it showed
HTTP/1.1 200 OK
Server: WEBrick/1.7.0 (Ruby/3.1.0/2021-12-25)
Date: Wed, 26 Jan 2022 03:48:33 GMT
Content-Length: 0
Connection: close
...
You can see the Content-Length header is there, and it does cause problems for some kinds of clients.
- Dominant language
- Ruby
- Stars
- 328
- Forks
- 114
- Avg merge
- 1h 15m
- Merged PRs (30d)
- 1
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ruby/webrick
-
Retire superfluous quoting of Content-Type: charset [RFC7230]Possibly taken @jeremyevans claimed this 62 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
CGI script using LF line breaks in headers causes errorPossibly taken @paulownia claimed this 603 days ago. Open
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
Difficulty 3/5 1-2 days Newbie friendliness 25/100
Similar issues
-
needs verification
Difficulty 2/5 1-3 hours Newbie friendliness 64/100
Maintainers usually reply within 13 days
-
🐛 bug 👩💻 équipe CE 🧑🏭 entreprises
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
betagouv/conseillers-entreprises#4808 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
yosiat/panko_serializer#250 ·