puma 1.2.0-java → 1.2.1-java

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.

@@ -1,3 +1,9 @@
1
+ === 1.2.1 / 2012-04-11
2
+
3
+ 1 bug fix:
4
+
5
+ * Fix rack.url_scheme for SSL servers. Fixes #65
6
+
1
7
  === 1.2.0 / 2012-04-11
2
8
 
3
9
  1 major feature:
@@ -75,7 +75,7 @@ module Puma
75
75
 
76
76
  PATH_INFO = 'PATH_INFO'.freeze
77
77
 
78
- PUMA_VERSION = VERSION = "1.2.0".freeze
78
+ PUMA_VERSION = VERSION = "1.2.1".freeze
79
79
 
80
80
  PUMA_TMP_BASE = "puma".freeze
81
81
 
Binary file
@@ -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[s] = env
140
+ @envs[ssl] = env
140
141
 
141
- @ios << OpenSSL::SSL::SSLServer.new(s, ctx)
142
+ @ios << ssl
142
143
  s
143
144
  end
144
145
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = "puma"
5
- s.version = "1.2.0"
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
@@ -2,7 +2,7 @@
2
2
  name: puma
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 1.2.0
5
+ version: 1.2.1
6
6
  platform: java
7
7
  authors:
8
8
  - Evan Phoenix
@@ -141,6 +141,7 @@ files:
141
141
  - test/test_ws.rb
142
142
  - test/testhelp.rb
143
143
  - tools/trickletest.rb
144
+ - test/test_puma_server.rb
144
145
  - lib/puma/puma_http11.jar
145
146
  homepage: http://puma.io
146
147
  licenses: []
@@ -178,6 +179,7 @@ test_files:
178
179
  - test/test_http11.rb
179
180
  - test/test_integration.rb
180
181
  - test/test_persistent.rb
182
+ - test/test_puma_server.rb
181
183
  - test/test_rack_handler.rb
182
184
  - test/test_rack_server.rb
183
185
  - test/test_thread_pool.rb