puma 1.2.0 → 1.2.1
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of puma might be problematic. Click here for more details.
- data/History.txt +6 -0
- data/lib/puma/const.rb +1 -1
- data/lib/puma/server.rb +3 -2
- data/puma.gemspec +3 -3
- data/test/test_puma_server.rb +56 -0
- metadata +5 -3
data/History.txt
CHANGED
data/lib/puma/const.rb
CHANGED
data/lib/puma/server.rb
CHANGED
@@ -134,11 +134,12 @@ module Puma
|
|
134
134
|
s.setsockopt(Socket::SOL_SOCKET,Socket::SO_REUSEADDR, true)
|
135
135
|
s.listen backlog
|
136
136
|
|
137
|
+
ssl = OpenSSL::SSL::SSLServer.new(s, ctx)
|
137
138
|
env = @proto_env.dup
|
138
139
|
env[HTTPS_KEY] = HTTPS
|
139
|
-
@envs[
|
140
|
+
@envs[ssl] = env
|
140
141
|
|
141
|
-
@ios <<
|
142
|
+
@ios << ssl
|
142
143
|
s
|
143
144
|
end
|
144
145
|
|
data/puma.gemspec
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Gem::Specification.new do |s|
|
4
4
|
s.name = "puma"
|
5
|
-
s.version = "1.2.
|
5
|
+
s.version = "1.2.1"
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ["Evan Phoenix"]
|
@@ -12,7 +12,7 @@ Gem::Specification.new do |s|
|
|
12
12
|
s.executables = ["puma", "pumactl"]
|
13
13
|
s.extensions = ["ext/puma_http11/extconf.rb"]
|
14
14
|
s.extra_rdoc_files = ["History.txt", "Manifest.txt"]
|
15
|
-
s.files = ["COPYING", "Gemfile", "History.txt", "LICENSE", "Manifest.txt", "README.md", "Rakefile", "TODO", "bin/puma", "bin/pumactl", "examples/CA/cacert.pem", "examples/CA/newcerts/cert_1.pem", "examples/CA/newcerts/cert_2.pem", "examples/CA/private/cakeypair.pem", "examples/CA/serial", "examples/config.rb", "examples/puma/cert_puma.pem", "examples/puma/csr_puma.pem", "examples/puma/puma_keypair.pem", "examples/qc_config.rb", "ext/puma_http11/PumaHttp11Service.java", "ext/puma_http11/ext_help.h", "ext/puma_http11/extconf.rb", "ext/puma_http11/http11_parser.c", "ext/puma_http11/http11_parser.h", "ext/puma_http11/http11_parser.java.rl", "ext/puma_http11/http11_parser.rl", "ext/puma_http11/http11_parser_common.rl", "ext/puma_http11/org/jruby/puma/Http11.java", "ext/puma_http11/org/jruby/puma/Http11Parser.java", "ext/puma_http11/puma_http11.c", "lib/puma.rb", "lib/puma/app/status.rb", "lib/puma/cli.rb", "lib/puma/compat.rb", "lib/puma/configuration.rb", "lib/puma/const.rb", "lib/puma/control_cli.rb", "lib/puma/events.rb", "lib/puma/jruby_restart.rb", "lib/puma/null_io.rb", "lib/puma/rack_patch.rb", "lib/puma/server.rb", "lib/puma/thread_pool.rb", "lib/rack/handler/puma.rb", "puma.gemspec", "test/ab_rs.rb", "test/config/app.rb", "test/hello.ru", "test/lobster.ru", "test/mime.yaml", "test/slow.ru", "test/test_app_status.rb", "test/test_cli.rb", "test/test_config.rb", "test/test_http10.rb", "test/test_http11.rb", "test/test_integration.rb", "test/test_persistent.rb", "test/test_rack_handler.rb", "test/test_rack_server.rb", "test/test_thread_pool.rb", "test/test_unix_socket.rb", "test/test_ws.rb", "test/testhelp.rb", "tools/trickletest.rb"]
|
15
|
+
s.files = ["COPYING", "Gemfile", "History.txt", "LICENSE", "Manifest.txt", "README.md", "Rakefile", "TODO", "bin/puma", "bin/pumactl", "examples/CA/cacert.pem", "examples/CA/newcerts/cert_1.pem", "examples/CA/newcerts/cert_2.pem", "examples/CA/private/cakeypair.pem", "examples/CA/serial", "examples/config.rb", "examples/puma/cert_puma.pem", "examples/puma/csr_puma.pem", "examples/puma/puma_keypair.pem", "examples/qc_config.rb", "ext/puma_http11/PumaHttp11Service.java", "ext/puma_http11/ext_help.h", "ext/puma_http11/extconf.rb", "ext/puma_http11/http11_parser.c", "ext/puma_http11/http11_parser.h", "ext/puma_http11/http11_parser.java.rl", "ext/puma_http11/http11_parser.rl", "ext/puma_http11/http11_parser_common.rl", "ext/puma_http11/org/jruby/puma/Http11.java", "ext/puma_http11/org/jruby/puma/Http11Parser.java", "ext/puma_http11/puma_http11.c", "lib/puma.rb", "lib/puma/app/status.rb", "lib/puma/cli.rb", "lib/puma/compat.rb", "lib/puma/configuration.rb", "lib/puma/const.rb", "lib/puma/control_cli.rb", "lib/puma/events.rb", "lib/puma/jruby_restart.rb", "lib/puma/null_io.rb", "lib/puma/rack_patch.rb", "lib/puma/server.rb", "lib/puma/thread_pool.rb", "lib/rack/handler/puma.rb", "puma.gemspec", "test/ab_rs.rb", "test/config/app.rb", "test/hello.ru", "test/lobster.ru", "test/mime.yaml", "test/slow.ru", "test/test_app_status.rb", "test/test_cli.rb", "test/test_config.rb", "test/test_http10.rb", "test/test_http11.rb", "test/test_integration.rb", "test/test_persistent.rb", "test/test_rack_handler.rb", "test/test_rack_server.rb", "test/test_thread_pool.rb", "test/test_unix_socket.rb", "test/test_ws.rb", "test/testhelp.rb", "tools/trickletest.rb", "test/test_puma_server.rb"]
|
16
16
|
s.homepage = "http://puma.io"
|
17
17
|
s.rdoc_options = ["--main", "README.md"]
|
18
18
|
s.require_paths = ["lib"]
|
@@ -20,7 +20,7 @@ Gem::Specification.new do |s|
|
|
20
20
|
s.rubyforge_project = "puma"
|
21
21
|
s.rubygems_version = "1.8.21"
|
22
22
|
s.summary = "Puma is a simple, fast, and highly concurrent HTTP 1.1 server for Ruby web applications"
|
23
|
-
s.test_files = ["test/test_app_status.rb", "test/test_cli.rb", "test/test_config.rb", "test/test_http10.rb", "test/test_http11.rb", "test/test_integration.rb", "test/test_persistent.rb", "test/test_rack_handler.rb", "test/test_rack_server.rb", "test/test_thread_pool.rb", "test/test_unix_socket.rb", "test/test_ws.rb"]
|
23
|
+
s.test_files = ["test/test_app_status.rb", "test/test_cli.rb", "test/test_config.rb", "test/test_http10.rb", "test/test_http11.rb", "test/test_integration.rb", "test/test_persistent.rb", "test/test_puma_server.rb", "test/test_rack_handler.rb", "test/test_rack_server.rb", "test/test_thread_pool.rb", "test/test_unix_socket.rb", "test/test_ws.rb"]
|
24
24
|
|
25
25
|
if s.respond_to? :specification_version then
|
26
26
|
s.specification_version = 3
|
@@ -0,0 +1,56 @@
|
|
1
|
+
require "rbconfig"
|
2
|
+
require 'test/unit'
|
3
|
+
require 'socket'
|
4
|
+
require 'openssl'
|
5
|
+
|
6
|
+
require 'puma/server'
|
7
|
+
|
8
|
+
require 'net/https'
|
9
|
+
|
10
|
+
class TestPumaServer < Test::Unit::TestCase
|
11
|
+
|
12
|
+
def setup
|
13
|
+
@port = 3212
|
14
|
+
@host = "127.0.0.1"
|
15
|
+
|
16
|
+
@app = lambda { |env| [200, {}, [env['rack.url_scheme']]] }
|
17
|
+
|
18
|
+
@events = Puma::Events.new STDOUT, STDERR
|
19
|
+
@server = Puma::Server.new @app, @events
|
20
|
+
|
21
|
+
@ssl_key = File.expand_path "../../examples/puma/puma_keypair.pem", __FILE__
|
22
|
+
@ssl_cert = File.expand_path "../../examples/puma/cert_puma.pem", __FILE__
|
23
|
+
end
|
24
|
+
|
25
|
+
def teardown
|
26
|
+
@server.stop
|
27
|
+
end
|
28
|
+
|
29
|
+
def test_url_scheme_for_https
|
30
|
+
ctx = OpenSSL::SSL::SSLContext.new
|
31
|
+
|
32
|
+
ctx.key = OpenSSL::PKey::RSA.new File.read(@ssl_key)
|
33
|
+
|
34
|
+
ctx.cert = OpenSSL::X509::Certificate.new File.read(@ssl_cert)
|
35
|
+
|
36
|
+
ctx.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
37
|
+
|
38
|
+
@server.add_ssl_listener @host, @port, ctx
|
39
|
+
@server.run
|
40
|
+
|
41
|
+
http = Net::HTTP.new @host, @port
|
42
|
+
http.use_ssl = true
|
43
|
+
http.verify_mode = OpenSSL::SSL::VERIFY_NONE
|
44
|
+
|
45
|
+
body = nil
|
46
|
+
http.start do
|
47
|
+
req = Net::HTTP::Get.new "/", {}
|
48
|
+
|
49
|
+
http.request(req) do |rep|
|
50
|
+
body = rep.body
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
assert_equal "https", body
|
55
|
+
end
|
56
|
+
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: puma
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 29
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 1
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 1.2.
|
9
|
+
- 1
|
10
|
+
version: 1.2.1
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Evan Phoenix
|
@@ -163,6 +163,7 @@ files:
|
|
163
163
|
- test/test_ws.rb
|
164
164
|
- test/testhelp.rb
|
165
165
|
- tools/trickletest.rb
|
166
|
+
- test/test_puma_server.rb
|
166
167
|
homepage: http://puma.io
|
167
168
|
licenses: []
|
168
169
|
|
@@ -207,6 +208,7 @@ test_files:
|
|
207
208
|
- test/test_http11.rb
|
208
209
|
- test/test_integration.rb
|
209
210
|
- test/test_persistent.rb
|
211
|
+
- test/test_puma_server.rb
|
210
212
|
- test/test_rack_handler.rb
|
211
213
|
- test/test_rack_server.rb
|
212
214
|
- test/test_thread_pool.rb
|