<feed xmlns='http://www.w3.org/2005/Atom'>
<title>ruby.git/lib/webrick/httprequest.rb, branch v2_7_8</title>
<subtitle>The Ruby Programming Language</subtitle>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/'/>
<entry>
<title>merge revision(s) d23d2f3f6fbb5d787b0dd80675c489a692be23e2:</title>
<updated>2020-09-29T13:46:14+00:00</updated>
<author>
<name>nagachika</name>
<email>nagachika@ruby-lang.org</email>
</author>
<published>2020-09-29T13:46:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=828c34e58b63d64558ec0f2d1d7ae401c5e6b21f'/>
<id>828c34e58b63d64558ec0f2d1d7ae401c5e6b21f</id>
<content type='text'>
	[ruby/webrick] Make it more strict to interpret some headers

	Some regexps were too tolerant.

	https://github.com/ruby/webrick/commit/8946bb38b4
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
	[ruby/webrick] Make it more strict to interpret some headers

	Some regexps were too tolerant.

	https://github.com/ruby/webrick/commit/8946bb38b4
</pre>
</div>
</content>
</entry>
<entry>
<title>[ruby/webrick] Support literal IPv6 addresses in X-Forwarded-Host</title>
<updated>2019-10-24T10:47:20+00:00</updated>
<author>
<name>Jeremy Evans</name>
<email>code@jeremyevans.net</email>
</author>
<published>2019-08-27T05:22:00+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=c28d50a753615dff9bd721f608846d4ef541feb1'/>
<id>c28d50a753615dff9bd721f608846d4ef541feb1</id>
<content type='text'>
https://github.com/ruby/webrick/commit/6b6990ec81
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
https://github.com/ruby/webrick/commit/6b6990ec81
</pre>
</div>
</content>
</entry>
<entry>
<title>lib/*: Prefer require_relative over require.</title>
<updated>2018-11-02T17:52:33+00:00</updated>
<author>
<name>marcandre</name>
<email>marcandre@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-11-02T17:52:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=e859e668d2eb59f34ad18edb7458ce90076617e9'/>
<id>e859e668d2eb59f34ad18edb7458ce90076617e9</id>
<content type='text'>
[#15206] [Fix GH-1976]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[#15206] [Fix GH-1976]

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@65505 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>webrick: raise EOFError in parse when read line is nil</title>
<updated>2018-09-24T07:48:33+00:00</updated>
<author>
<name>normal</name>
<email>normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-09-24T07:48:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1aef602d5a9398ff362de212ae402ffcd8ff76ae'/>
<id>1aef602d5a9398ff362de212ae402ffcd8ff76ae</id>
<content type='text'>
[Bug #15146]

From: Justin Li &lt;git@justinli.net&gt;

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
[Bug #15146]

From: Justin Li &lt;git@justinli.net&gt;

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@64823 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>repatch r62966 and r62969.</title>
<updated>2018-04-03T10:22:45+00:00</updated>
<author>
<name>ko1</name>
<email>ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-04-03T10:22:45+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=1751ea76a4583a1796324135fa5d30fef6abfc24'/>
<id>1751ea76a4583a1796324135fa5d30fef6abfc24</id>
<content type='text'>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63074 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>Revert r62966 and r62969</title>
<updated>2018-04-03T07:54:18+00:00</updated>
<author>
<name>naruse</name>
<email>naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-04-03T07:54:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=0c632c6fd391546cab623644aecc0ed85b1363da'/>
<id>0c632c6fd391546cab623644aecc0ed85b1363da</id>
<content type='text'>
It breaks mswin's test-all

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
It breaks mswin's test-all

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>webrick/httpproxy: stream request and response bodies</title>
<updated>2018-03-28T08:06:55+00:00</updated>
<author>
<name>normal</name>
<email>normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-03-28T08:06:55+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=706c028909df2f9526c1cde1c2baa6bc0b4d318a'/>
<id>706c028909df2f9526c1cde1c2baa6bc0b4d318a</id>
<content type='text'>
Reading entire request or response bodies into memory can lead
to trivial denial-of-service attacks.  Introduce Fibers in both
cases to allow streaming.

WEBrick::HTTPRequest gains a new body_reader method to prepare
itself as a source for IO.copy_stream.  This allows the
WEBrick::HTTPRequest object to be used as the
Net::HTTPGenericRequest#body_stream= arg for Net::HTTP.

For HTTP proxy response bodies, we also use a Fiber to
to make the HTTP request and read the response body.

* lib/webrick/httprequest.rb (body_reader): new method
  (readpartial): ditto
* lib/webrick/httpproxy.rb (perform_proxy_request): use Fiber
  to stream response body
  (do_GET, do_HEAD): adjust call
  (do_POST): adjust call and supply body_reader
* test/webrick/test_httprequest.rb (test_chunked): test
  for IO.copy_stream compatibility
* test/webrick/test_httpproxy.rb (test_big_bodies): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Reading entire request or response bodies into memory can lead
to trivial denial-of-service attacks.  Introduce Fibers in both
cases to allow streaming.

WEBrick::HTTPRequest gains a new body_reader method to prepare
itself as a source for IO.copy_stream.  This allows the
WEBrick::HTTPRequest object to be used as the
Net::HTTPGenericRequest#body_stream= arg for Net::HTTP.

For HTTP proxy response bodies, we also use a Fiber to
to make the HTTP request and read the response body.

* lib/webrick/httprequest.rb (body_reader): new method
  (readpartial): ditto
* lib/webrick/httpproxy.rb (perform_proxy_request): use Fiber
  to stream response body
  (do_GET, do_HEAD): adjust call
  (do_POST): adjust call and supply body_reader
* test/webrick/test_httprequest.rb (test_chunked): test
  for IO.copy_stream compatibility
* test/webrick/test_httpproxy.rb (test_big_bodies): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62966 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>webrick/httprequest: use InputBufferSize for chunked requests</title>
<updated>2018-03-28T08:06:39+00:00</updated>
<author>
<name>normal</name>
<email>normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-03-28T08:06:39+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=2d41d88c4d213f56cd8cefe368699cee896129f1'/>
<id>2d41d88c4d213f56cd8cefe368699cee896129f1</id>
<content type='text'>
While WEBrick::HTTPRequest#body provides a Proc interface
for streaming large request bodies, clients must not force
the server to use an excessively large chunk size.

* lib/webrick/httprequest.rb (read_chunk_size): limit each
  read and block.call to :InputBufferSize in config.
* test/webrick/test_httpserver.rb (test_big_chunks): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
While WEBrick::HTTPRequest#body provides a Proc interface
for streaming large request bodies, clients must not force
the server to use an excessively large chunk size.

* lib/webrick/httprequest.rb (read_chunk_size): limit each
  read and block.call to :InputBufferSize in config.
* test/webrick/test_httpserver.rb (test_big_chunks): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62963 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>webrick/httprequest: raise correct exception</title>
<updated>2018-03-28T08:06:34+00:00</updated>
<author>
<name>normal</name>
<email>normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-03-28T08:06:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=6db6eb572b512998ccfde31610fe18f522d9ba86'/>
<id>6db6eb572b512998ccfde31610fe18f522d9ba86</id>
<content type='text'>
"BadRequest" alone does not resolve correctly, it is in the
HTTPStatus namespace.

* lib/webrick/httprequest.rb (read_chunked): use correct exception
* test/webrick/test_httpserver.rb (test_eof_in_chunk): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
"BadRequest" alone does not resolve correctly, it is in the
HTTPStatus namespace.

* lib/webrick/httprequest.rb (read_chunked): use correct exception
* test/webrick/test_httpserver.rb (test_eof_in_chunk): new test

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62962 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
<entry>
<title>webrick/httprequest: limit request headers size</title>
<updated>2018-03-28T08:06:23+00:00</updated>
<author>
<name>normal</name>
<email>normal@b2dd03c8-39d4-4d8f-98ff-823fe69b080e</email>
</author>
<published>2018-03-28T08:06:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.ruby-lang.org/ruby.git/commit/?id=7e1f2a5aa9d60deec2f84557c6b9032953151ca9'/>
<id>7e1f2a5aa9d60deec2f84557c6b9032953151ca9</id>
<content type='text'>
We use the same 112 KB limit started (AFAIK) by Mongrel, Thin,
and Puma to prevent malicious users from using up all the memory
with a single request.  This also limits the damage done by
excessive ranges in multipart Range: requests.

Due to the way we rely on IO#gets and the desire to keep
the code simple, the actual maximum header may be 4093 bytes
larger than 112 KB, but we're splitting hairs at that point.

* lib/webrick/httprequest.rb: define MAX_HEADER_LENGTH
  (read_header): raise when headers exceed max length

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
We use the same 112 KB limit started (AFAIK) by Mongrel, Thin,
and Puma to prevent malicious users from using up all the memory
with a single request.  This also limits the damage done by
excessive ranges in multipart Range: requests.

Due to the way we rely on IO#gets and the desire to keep
the code simple, the actual maximum header may be 4093 bytes
larger than 112 KB, but we're splitting hairs at that point.

* lib/webrick/httprequest.rb: define MAX_HEADER_LENGTH
  (read_header): raise when headers exceed max length

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62960 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
</pre>
</div>
</content>
</entry>
</feed>
