fishwife 1.8.0-java → 1.8.1-java

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: dde09a0a87fbd2aa589d44a02616cb08993cca24
4
- data.tar.gz: b88680fc0b5dfa5ab36e111310fec7a087ead6c1
3
+ metadata.gz: da6bb47238b5e657b46cfd57554067e416167bdc
4
+ data.tar.gz: 7c1e89a29da563c3a6d85f6abb2c80e0b572c3ba
5
5
  SHA512:
6
- metadata.gz: 1bdd3ba4110e324a8a5b678102c25edab31872633f29ffab82fc523f1f964eb3c9d3d750ed09fda8832edbcb3f6aa82018a7485824c22f4420b9bff55307fb68
7
- data.tar.gz: df9ce253c9096bf6db08b5f058a1c377b408dd4f8b781a42d73ac7014b15f4a8eec920d71ee480ff3b66b7753cbb04d88634a29086ef5aef3db8d31a8cc89266
6
+ metadata.gz: 32f7500ca1dc117376dfb5a012e2095b552d6b064624e4eb401c795d9d6ed906e09445b1c33594a705d42367a194dcd9a562b7fe0a688aada43c7af17c8ba272
7
+ data.tar.gz: e9cea7ca709a9dc2b7fce66a2e45f75cddc03b95bdfae87e153f79d83c899f4ca9dc72498abad672f6b10b2a084876526df889ec3343f64b21b8d193e974b352
@@ -1,3 +1,8 @@
1
+ === 1.8.1 (2016-3-30)
2
+ * Avoid mutating the rack response headers hash as part of the special
3
+ handling of Content-Length and Content-Type. Rack applications may
4
+ wish to use (frozen) headers constants. (Theo Hultberg, #11)
5
+
1
6
  === 1.8.0 (2015-5-3)
2
7
  * Added Fishwife::HttpServer::new :connections configuration, allowing
3
8
  multiple connectors and including SSL support. (#10 with Gregory
@@ -19,4 +19,4 @@ spec/test_app.rb
19
19
  spec/data/hello.txt
20
20
  spec/data/localhost.keystore
21
21
  spec/data/reddit-icon.png
22
- lib/fishwife/fishwife-1.8.0.jar
22
+ lib/fishwife/fishwife-1.8.1.jar
@@ -96,7 +96,7 @@ Unix-like logrotate(8) may be used with the former process monitors.
96
96
 
97
97
  == License
98
98
 
99
- Copyright (c) 2011-2015 David Kellum
99
+ Copyright (c) 2011-2016 David Kellum
100
100
 
101
101
  Licensed under the Apache License, Version 2.0 (the "License"); you
102
102
  may not use this file except in compliance with the License. You
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env jruby
2
2
  # -*- ruby -*-
3
3
  #--
4
- # Copyright (c) 2011-2015 David Kellum
4
+ # Copyright (c) 2011-2016 David Kellum
5
5
  # Copyright (c) 2010-2011 Don Werve
6
6
  #
7
7
  # Licensed under the Apache License, Version 2.0 (the "License"); you
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011-2015 David Kellum
2
+ # Copyright (c) 2011-2016 David Kellum
3
3
  # Copyright (c) 2010-2011 Don Werve
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License"); you
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011-2015 David Kellum
2
+ # Copyright (c) 2011-2016 David Kellum
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you
5
5
  # may not use this file except in compliance with the License. You may
@@ -15,6 +15,6 @@
15
15
  #++
16
16
 
17
17
  module Fishwife
18
- VERSION = '1.8.0'
18
+ VERSION = '1.8.1'
19
19
  LIB_DIR = File.dirname( __FILE__ )
20
20
  end
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011-2015 David Kellum
2
+ # Copyright (c) 2011-2016 David Kellum
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you
5
5
  # may not use this file except in compliance with the License. You may
@@ -70,10 +70,17 @@ module Fishwife
70
70
  # :max_idle_time_ms:: See above
71
71
  # :key_store_path:: For ssl, the path to the (Java JKS) keystore
72
72
  # :key_store_password:: For ssl, the password to the keystore
73
+ # :inherit_channel:: If "true" (String) or true (TrueClass), use
74
+ # the socket bound to standard input. This can
75
+ # be used for inetd-style socket activation and
76
+ # hot deploy. It can be arranged via
77
+ # {start_server}[https://metacpan.org/pod/start_server]
78
+ # (Requires rjack-jetty 9.3.7+; Default: false)
73
79
  #
74
80
  # URI examples:
75
81
  #
76
82
  # tcp://127.0.0.1
83
+ # tcp://127.0.0.1?inherit_channel=true
77
84
  # ssl://0.0.0.0:8443?key_store_path=keystore&key_store_password=399as8d9
78
85
  #
79
86
  def initialize( options = {} )
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011-2015 David Kellum
2
+ # Copyright (c) 2011-2016 David Kellum
3
3
  # Copyright (c) 2010-2011 Don Werve
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License"); you
@@ -255,17 +255,18 @@ module Fishwife
255
255
  # Set the HTTP status code.
256
256
  response.setStatus(status.to_i)
257
257
 
258
- # Did we get a Content-Length header?
259
- content_length = headers.delete('Content-Length')
260
- response.setContentLength(content_length.to_i) if content_length
261
-
262
- # Did we get a Content-Type header?
263
- content_type = headers.delete('Content-Type')
264
- response.setContentType(content_type) if content_type
265
-
266
258
  # Add all the result headers.
267
259
  headers.each do |h, v|
268
- v.split("\n").each { |val| response.addHeader(h, val) }
260
+ case h
261
+ when 'Content-Length'
262
+ # Did we get a Content-Length header?
263
+ response.setContentLength(v.to_i) if v
264
+ when 'Content-Type'
265
+ # Did we get a Content-Type header?
266
+ response.setContentType(v) if v
267
+ else
268
+ v.split("\n").each { |val| response.addHeader(h, val) }
269
+ end
269
270
  end
270
271
  end
271
272
 
@@ -276,7 +277,9 @@ module Fishwife
276
277
  path = body.to_path
277
278
 
278
279
  # Set Content-Length unless this is an async request.
279
- response.setContentLength( File.size( path ) ) unless content_length
280
+ unless headers['Content-Length']
281
+ response.setContentLength( File.size( path ) )
282
+ end
280
283
 
281
284
  # FIXME: Support ranges?
282
285
 
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011-2015 David Kellum
2
+ # Copyright (c) 2011-2016 David Kellum
3
3
  #
4
4
  # Licensed under the Apache License, Version 2.0 (the "License"); you
5
5
  # may not use this file except in compliance with the License. You may
data/pom.xml CHANGED
@@ -4,7 +4,7 @@
4
4
  <groupId>fishwife</groupId>
5
5
  <artifactId>fishwife</artifactId>
6
6
  <packaging>jar</packaging>
7
- <version>1.8.0</version>
7
+ <version>1.8.1</version>
8
8
  <name>Fishwife Java Extension</name>
9
9
 
10
10
  <properties>
@@ -36,8 +36,8 @@
36
36
  <artifactId>maven-compiler-plugin</artifactId>
37
37
  <version>2.3.2</version>
38
38
  <configuration>
39
- <source>1.6</source>
40
- <target>1.6</target>
39
+ <source>1.7</source>
40
+ <target>1.7</target>
41
41
  <optimize>true</optimize>
42
42
  <debug>true</debug>
43
43
  <encoding>UTF-8</encoding>
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011-2015 David Kellum
2
+ # Copyright (c) 2011-2016 David Kellum
3
3
  # Copyright (c) 2010-2011 Don Werve
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License"); you
@@ -65,6 +65,7 @@ describe Fishwife do
65
65
  if @scheme == :https
66
66
  @https_client_opts = {
67
67
  :use_ssl => true,
68
+ :ciphers => "ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-AES256-GCM-SHA384:DHE-RSA-AES128-GCM-SHA256:DHE-DSS-AES128-GCM-SHA256:kEDH+AESGCM:ECDHE-RSA-AES128-SHA256:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA:ECDHE-ECDSA-AES128-SHA:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA:ECDHE-ECDSA-AES256-SHA:DHE-RSA-AES128-SHA256:DHE-RSA-AES128-SHA:DHE-DSS-AES128-SHA256:DHE-RSA-AES256-SHA256:DHE-DSS-AES256-SHA:DHE-RSA-AES256-SHA:AES128-GCM-SHA256:AES256-GCM-SHA384:AES128-SHA256:AES256-SHA256:AES128-SHA:AES256-SHA:AES:CAMELLIA:DES-CBC3-SHA:!aNULL:!eNULL:!EXPORT:!DES:!RC4:!MD5:!PSK:!aECDH:!EDH-DSS-DES-CBC3-SHA:!EDH-RSA-DES-CBC3-SHA:!KRB5-DES-CBC3-SHA",
68
69
  :verify_mode => OpenSSL::SSL::VERIFY_NONE }
69
70
  @options[:connections] = [ {
70
71
  :scheme => 'ssl',
@@ -143,16 +144,26 @@ describe Fishwife do
143
144
  it "Rejects request body larger than maximum" do
144
145
  body = '<' + "f" * (100*1024) + '>'
145
146
  headers = { "Content-Type" => "text/plain" }
146
- response = post("/count", nil, headers, body)
147
- response.code.should == "413"
147
+ begin
148
+ response = post("/count", nil, headers, body)
149
+ response.code.should == "413"
150
+ rescue IOError, Errno::EPIPE, Errno::ECONNRESET => e
151
+ # or alternatively, our send pipe breaks in mid-send
152
+ e.message.should match( /broken pipe/i )
153
+ end
148
154
  end
149
155
 
150
156
  it "Rejects request body larger than maximum in chunked request" do
151
157
  body = '<' + "f" * (100*1024) + '>'
152
158
  headers = { "Content-Type" => "text/plain",
153
159
  "Transfer-Encoding" => "chunked" }
154
- response = post("/count", nil, headers, StringIO.new( body ) )
155
- response.code.should == "413"
160
+ begin
161
+ response = post("/count", nil, headers, StringIO.new( body ) )
162
+ response.code.should == "413"
163
+ rescue IOError, Errno::EPIPE, Errno::ECONNRESET => e
164
+ # or alternatively, our send pipe breaks in mid-send
165
+ e.message.should match( /broken pipe/i )
166
+ end
156
167
  end
157
168
 
158
169
  it "passes custom headers" do
@@ -243,6 +254,11 @@ describe Fishwife do
243
254
  lock.synchronize { buffer.count.should == 10 }
244
255
  end
245
256
 
257
+ it "handles frozen Rack responses" do
258
+ response = get("/frozen_response")
259
+ response.code.should == "200"
260
+ end
261
+
246
262
  end
247
263
 
248
264
  end
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011-2015 David Kellum
2
+ # Copyright (c) 2011-2016 David Kellum
3
3
  # Copyright (c) 2010-2011 Don Werve
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License"); you
@@ -1,5 +1,5 @@
1
1
  #--
2
- # Copyright (c) 2011-2015 David Kellum
2
+ # Copyright (c) 2011-2016 David Kellum
3
3
  # Copyright (c) 2010-2011 Don Werve
4
4
  #
5
5
  # Licensed under the Apache License, Version 2.0 (the "License"); you
@@ -126,4 +126,8 @@ class TestApp
126
126
  response.write(checksum)
127
127
  response.finish
128
128
  end
129
+
130
+ def frozen_response(request)
131
+ [200, {}.freeze, [].freeze].freeze
132
+ end
129
133
  end
metadata CHANGED
@@ -1,22 +1,22 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: fishwife
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.8.0
4
+ version: 1.8.1
5
5
  platform: java
6
6
  authors:
7
7
  - David Kellum
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-05-03 00:00:00.000000000 Z
11
+ date: 2016-03-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement
15
15
  requirements:
16
- - - '>='
16
+ - - ">="
17
17
  - !ruby/object:Gem::Version
18
18
  version: 1.5.2
19
- - - <
19
+ - - "<"
20
20
  - !ruby/object:Gem::Version
21
21
  version: '1.7'
22
22
  name: rack
@@ -24,19 +24,19 @@ dependencies:
24
24
  type: :runtime
25
25
  version_requirements: !ruby/object:Gem::Requirement
26
26
  requirements:
27
- - - '>='
27
+ - - ">="
28
28
  - !ruby/object:Gem::Version
29
29
  version: 1.5.2
30
- - - <
30
+ - - "<"
31
31
  - !ruby/object:Gem::Version
32
32
  version: '1.7'
33
33
  - !ruby/object:Gem::Dependency
34
34
  requirement: !ruby/object:Gem::Requirement
35
35
  requirements:
36
- - - '>='
36
+ - - ">="
37
37
  - !ruby/object:Gem::Version
38
38
  version: 9.2.11
39
- - - <
39
+ - - "<"
40
40
  - !ruby/object:Gem::Version
41
41
  version: '9.4'
42
42
  name: rjack-jetty
@@ -44,16 +44,16 @@ dependencies:
44
44
  type: :runtime
45
45
  version_requirements: !ruby/object:Gem::Requirement
46
46
  requirements:
47
- - - '>='
47
+ - - ">="
48
48
  - !ruby/object:Gem::Version
49
49
  version: 9.2.11
50
- - - <
50
+ - - "<"
51
51
  - !ruby/object:Gem::Version
52
52
  version: '9.4'
53
53
  - !ruby/object:Gem::Dependency
54
54
  requirement: !ruby/object:Gem::Requirement
55
55
  requirements:
56
- - - ~>
56
+ - - "~>"
57
57
  - !ruby/object:Gem::Version
58
58
  version: 1.7.2
59
59
  name: rjack-slf4j
@@ -61,13 +61,13 @@ dependencies:
61
61
  type: :runtime
62
62
  version_requirements: !ruby/object:Gem::Requirement
63
63
  requirements:
64
- - - ~>
64
+ - - "~>"
65
65
  - !ruby/object:Gem::Version
66
66
  version: 1.7.2
67
67
  - !ruby/object:Gem::Dependency
68
68
  requirement: !ruby/object:Gem::Requirement
69
69
  requirements:
70
- - - ~>
70
+ - - "~>"
71
71
  - !ruby/object:Gem::Version
72
72
  version: 1.8.2
73
73
  name: json
@@ -75,13 +75,13 @@ dependencies:
75
75
  type: :development
76
76
  version_requirements: !ruby/object:Gem::Requirement
77
77
  requirements:
78
- - - ~>
78
+ - - "~>"
79
79
  - !ruby/object:Gem::Version
80
80
  version: 1.8.2
81
81
  - !ruby/object:Gem::Dependency
82
82
  requirement: !ruby/object:Gem::Requirement
83
83
  requirements:
84
- - - ~>
84
+ - - "~>"
85
85
  - !ruby/object:Gem::Version
86
86
  version: '1.5'
87
87
  name: rjack-logback
@@ -89,13 +89,13 @@ dependencies:
89
89
  type: :development
90
90
  version_requirements: !ruby/object:Gem::Requirement
91
91
  requirements:
92
- - - ~>
92
+ - - "~>"
93
93
  - !ruby/object:Gem::Version
94
94
  version: '1.5'
95
95
  - !ruby/object:Gem::Dependency
96
96
  requirement: !ruby/object:Gem::Requirement
97
97
  requirements:
98
- - - ~>
98
+ - - "~>"
99
99
  - !ruby/object:Gem::Version
100
100
  version: 2.13.0
101
101
  name: rspec
@@ -103,13 +103,13 @@ dependencies:
103
103
  type: :development
104
104
  version_requirements: !ruby/object:Gem::Requirement
105
105
  requirements:
106
- - - ~>
106
+ - - "~>"
107
107
  - !ruby/object:Gem::Version
108
108
  version: 2.13.0
109
109
  - !ruby/object:Gem::Dependency
110
110
  requirement: !ruby/object:Gem::Requirement
111
111
  requirements:
112
- - - ~>
112
+ - - "~>"
113
113
  - !ruby/object:Gem::Version
114
114
  version: '2.1'
115
115
  name: rjack-tarpit
@@ -117,7 +117,7 @@ dependencies:
117
117
  type: :development
118
118
  version_requirements: !ruby/object:Gem::Requirement
119
119
  requirements:
120
- - - ~>
120
+ - - "~>"
121
121
  - !ruby/object:Gem::Version
122
122
  version: '2.1'
123
123
  description: A hard working threaded HTTP 1.1 Rack server for JRuby using Jetty 7.x or 9.x. Fishwife deploys and operates like other Ruby HTTP servers/rack handlers such as Mongrel or Puma. No Java legacy war files (e.g. warbler) required.
@@ -141,7 +141,7 @@ files:
141
141
  - example/ssl.ru
142
142
  - lib/fishwife.rb
143
143
  - lib/fishwife/base.rb
144
- - lib/fishwife/fishwife-1.8.0.jar
144
+ - lib/fishwife/fishwife-1.8.1.jar
145
145
  - lib/fishwife/http_server.rb
146
146
  - lib/fishwife/rack_servlet.rb
147
147
  - lib/rack/handler/fishwife.rb
@@ -157,23 +157,23 @@ licenses: []
157
157
  metadata: {}
158
158
  post_install_message:
159
159
  rdoc_options:
160
- - --main
160
+ - "--main"
161
161
  - README.rdoc
162
162
  require_paths:
163
163
  - lib
164
164
  required_ruby_version: !ruby/object:Gem::Requirement
165
165
  requirements:
166
- - - '>='
166
+ - - ">="
167
167
  - !ruby/object:Gem::Version
168
168
  version: '0'
169
169
  required_rubygems_version: !ruby/object:Gem::Requirement
170
170
  requirements:
171
- - - '>='
171
+ - - ">="
172
172
  - !ruby/object:Gem::Version
173
173
  version: '0'
174
174
  requirements: []
175
175
  rubyforge_project:
176
- rubygems_version: 2.4.5
176
+ rubygems_version: 2.4.8
177
177
  signing_key:
178
178
  specification_version: 4
179
179
  summary: A Jetty based Rack HTTP 1.1 server.