unicorn 2.0.0pre2 → 2.0.0pre2.1.ge991
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/ext/unicorn_http/unicorn_http.rl +0 -1
- data/test/unit/test_http_parser_ng.rb +25 -0
- metadata +4 -2
@@ -473,4 +473,29 @@ class HttpParserNgTest < Test::Unit::TestCase
|
|
473
473
|
assert_equal expect, req
|
474
474
|
end
|
475
475
|
|
476
|
+
def test_pipelined_requests
|
477
|
+
expect = {
|
478
|
+
"HTTP_HOST" => "example.com",
|
479
|
+
"SERVER_NAME" => "example.com",
|
480
|
+
"REQUEST_PATH" => "/",
|
481
|
+
"rack.url_scheme" => "http",
|
482
|
+
"SERVER_PROTOCOL" => "HTTP/1.1",
|
483
|
+
"PATH_INFO" => "/",
|
484
|
+
"HTTP_VERSION" => "HTTP/1.1",
|
485
|
+
"REQUEST_URI" => "/",
|
486
|
+
"SERVER_PORT" => "80",
|
487
|
+
"REQUEST_METHOD" => "GET",
|
488
|
+
"QUERY_STRING" => ""
|
489
|
+
}
|
490
|
+
str = "GET / HTTP/1.1\r\nHost: example.com\r\n\r\n"
|
491
|
+
@parser.buf << (str * 2)
|
492
|
+
env1 = @parser.parse.dup
|
493
|
+
assert_equal expect, env1
|
494
|
+
assert_equal str, @parser.buf
|
495
|
+
assert @parser.keepalive?
|
496
|
+
@parser.reset
|
497
|
+
env2 = @parser.parse.dup
|
498
|
+
assert_equal expect, env2
|
499
|
+
assert_equal "", @parser.buf
|
500
|
+
end
|
476
501
|
end
|
metadata
CHANGED
@@ -1,13 +1,15 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: unicorn
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 12487189
|
5
5
|
prerelease: true
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 0
|
9
9
|
- 0pre2
|
10
|
-
|
10
|
+
- 1
|
11
|
+
- ge991
|
12
|
+
version: 2.0.0pre2.1.ge991
|
11
13
|
platform: ruby
|
12
14
|
authors:
|
13
15
|
- Unicorn hackers
|