thin 1.6.1 → 1.6.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 5b86053bf6306bf5e74447c600d9f21a4367bac0
4
- data.tar.gz: 44c44115170e5a9c1631d0801325544c029ed33a
3
+ metadata.gz: e842069e783c48060e71f494c190904609d5a587
4
+ data.tar.gz: dbc7a2d780bde4e6420f59432966bf359f6b1dd8
5
5
  SHA512:
6
- metadata.gz: 8ef281669d02cb8f02435c98ad999237cbafeff621223636add422a3dd563d9b18a60ff189f94f658917c23b0ca50669c02e4d1da824458cfe5439ca21146ed0
7
- data.tar.gz: 1d998ca3f97df8f31a41ad9fb1c92e4ee2ba3f2400c5e6052ba8318b3d777aa7d1dac02d71b29f079cb7b8b83b9d1efb232c5a96f11e022b790732b8aaa6c4e3
6
+ metadata.gz: a95d911c6bfa01811a38e5f383cc7c8b021c04af04770fa7f21c4685e37ddb9425eada286a141ccff47df9e0b91321c338f68f9ae2c3956c17276ce66f43cb67
7
+ data.tar.gz: 942aa9be0433894ccef664400e1b8aff0a34e03b9fcc449dc1b13f3c4dc1d87034203748694b65bddc616e0beee9624b8c5990c32f79ffa9373b8acd0803a9fa
data/CHANGELOG CHANGED
@@ -1,3 +1,8 @@
1
+ == 1.6.2 Doc Brown
2
+ * No longer replace response's body on HEAD request. Ensuring body.close will be called.
3
+ * Remove `---ssl-verify` option as EventMachine doesn't verify the certificate.
4
+ * Fix env['rack.peer_cert'] to return SSL certifcate.
5
+
1
6
  == 1.6.1 Death Proof
2
7
  * Regression: Default logger to STDOUT when using outside of CLI.
3
8
  * Regression: Downgrade Rack required version back to 1.0 to work w/ prior Rails versions.
data/Rakefile CHANGED
@@ -1,4 +1,5 @@
1
1
  require 'rake'
2
+ require 'rake/clean'
2
3
  load 'thin.gemspec'
3
4
 
4
5
  # Load tasks in tasks/
@@ -21,4 +22,4 @@ task :install => :build do
21
22
  end
22
23
 
23
24
  desc "Release version #{Thin::VERSION::STRING}"
24
- task :release => [:tag, :push]
25
+ task :release => [:tag, :push]
@@ -10,8 +10,6 @@ module Thin
10
10
  # This is a template async response. N.B. Can't use string for body on 1.9
11
11
  AsyncResponse = [-1, {}, []].freeze
12
12
 
13
- EMPTY_BODY = [].freeze
14
-
15
13
  # Rack application (adapter) served by this connection.
16
14
  attr_accessor :app
17
15
 
@@ -56,6 +54,12 @@ module Thin
56
54
  end
57
55
  end
58
56
 
57
+ def ssl_verify_peer(cert)
58
+ # In order to make the cert available later we have to have made at least
59
+ # a show of verifying it.
60
+ true
61
+ end
62
+
59
63
  def pre_process
60
64
  # Add client info to the request env
61
65
  @request.remote_address = remote_address
@@ -101,7 +105,7 @@ module Thin
101
105
  "Probably you wanted it to be an empty string?") if @response.body.nil?
102
106
 
103
107
  # HEAD requests should not return a body.
104
- @response.body = EMPTY_BODY if @request.head?
108
+ @response.skip_body! if @request.head?
105
109
 
106
110
  # Make the response persistent if requested by the client
107
111
  @response.persistent! if @request.persistent?
@@ -55,7 +55,7 @@ module Thin
55
55
  # ssl support
56
56
  if @options[:ssl]
57
57
  server.ssl = true
58
- server.ssl_options = { :private_key_file => @options[:ssl_key_file], :cert_chain_file => @options[:ssl_cert_file], :verify_peer => @options[:ssl_verify] }
58
+ server.ssl_options = { :private_key_file => @options[:ssl_key_file], :cert_chain_file => @options[:ssl_cert_file], :verify_peer => true }
59
59
  end
60
60
 
61
61
  # Detach the process, after this line the current process returns
@@ -27,6 +27,7 @@ module Thin
27
27
  @headers = Headers.new
28
28
  @status = 200
29
29
  @persistent = false
30
+ @skip_body = false
30
31
  end
31
32
 
32
33
  # String representation of the headers
@@ -87,10 +88,13 @@ module Thin
87
88
  # define your own +each+ method on +body+.
88
89
  def each
89
90
  yield head
90
- if @body.is_a?(String)
91
- yield @body
92
- else
93
- @body.each { |chunk| yield chunk }
91
+
92
+ unless @skip_body
93
+ if @body.is_a?(String)
94
+ yield @body
95
+ else
96
+ @body.each { |chunk| yield chunk }
97
+ end
94
98
  end
95
99
  end
96
100
 
@@ -105,5 +109,9 @@ module Thin
105
109
  def persistent?
106
110
  (@persistent && @headers.has_key?(CONTENT_LENGTH)) || PERSISTENT_STATUSES.include?(@status)
107
111
  end
112
+
113
+ def skip_body!
114
+ @skip_body = true
115
+ end
108
116
  end
109
117
  end
@@ -79,7 +79,6 @@ module Thin
79
79
  opts.on( "--ssl", "Enables SSL") { @options[:ssl] = true }
80
80
  opts.on( "--ssl-key-file PATH", "Path to private key") { |path| @options[:ssl_key_file] = path }
81
81
  opts.on( "--ssl-cert-file PATH", "Path to certificate") { |path| @options[:ssl_cert_file] = path }
82
- opts.on( "--ssl-verify", "Enables SSL certificate verification") { @options[:ssl_verify] = true }
83
82
 
84
83
  opts.separator ""
85
84
  opts.separator "Adapter options:"
@@ -6,11 +6,11 @@ module Thin
6
6
  module VERSION #:nodoc:
7
7
  MAJOR = 1
8
8
  MINOR = 6
9
- TINY = 1
9
+ TINY = 2
10
10
 
11
11
  STRING = [MAJOR, MINOR, TINY].join('.')
12
12
 
13
- CODENAME = "Death Proof".freeze
13
+ CODENAME = "Doc Brown".freeze
14
14
 
15
15
  RACK = [1, 0].freeze # Rack protocol version
16
16
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: thin
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.6.1
4
+ version: 1.6.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Marc-Andre Cournoyer
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-10-31 00:00:00.000000000 Z
11
+ date: 2014-03-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack