torquebox-web 4.0.0.alpha1-java → 4.0.0.beta1-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: 55cd60b73ff00c5b70ead500b540a3157d6f62ea
4
- data.tar.gz: f03d8c919a518bed4b6e9f62287d9b2f93ee99b7
3
+ metadata.gz: 164f47261d59b96948f547d2689a45306d85a46e
4
+ data.tar.gz: 33275d3c626a06ce82348c543ccc8ba72a162a9f
5
5
  SHA512:
6
- metadata.gz: ac3498da9cb459c950104e36c7758b99f457e98fc72af539331c1412389219e2162b190e04b7289a4818f5b638255bea4d8457f9d02f3666d832e653272f7dd8
7
- data.tar.gz: 0bf863321a0e9c8bb7052bcabd8a82e7b8b8076a868abf9764b265485b4bbf596bda9e424d63c341e73bfb8d7de71650c3cfcce4c55a5aae3d8c42fdefcec5bf
6
+ metadata.gz: 285d3eef4722191b94330ea756b064bd1a1575642f20e5e41e23dd3d3f40490b5be76aa11e3546ac1b766582d28be915fd7650c886b3fc7b9b0d737055dbe5fa
7
+ data.tar.gz: c28e31a71ee2e20efca16fc3666ca238232fa068265394296ad2d5de43ac7d0d98eca721edbc15d4b9d240534f32deb06a9f0ec84732c26d4752ad25d949287b
@@ -168,6 +168,7 @@ module TorqueBox
168
168
  @logger.trace("Registering handler at context path {}", options[:path])
169
169
  @web_component.register_handler(handler, register_options)
170
170
  end
171
+ start if @options[:auto_start]
171
172
  handler
172
173
  end
173
174
 
@@ -275,12 +276,12 @@ module TorqueBox
275
276
 
276
277
  def initialize(name, options = {})
277
278
  @logger = WB.logger('TorqueBox::Web::Server')
278
- options = DEFAULT_SERVER_OPTIONS.merge(options)
279
- unless options[:configuration]
280
- options = Undertow.builder(options)
279
+ @options = DEFAULT_SERVER_OPTIONS.merge(options)
280
+ unless @options[:configuration]
281
+ @options = Undertow.builder(options)
281
282
  end
282
- validate_options(options, DEFAULT_SERVER_OPTIONS.keys)
283
- create_options = extract_options(options, WBWeb::CreateOption)
283
+ validate_options(@options, DEFAULT_SERVER_OPTIONS.keys)
284
+ create_options = extract_options(@options, WBWeb::CreateOption)
284
285
  web = WB.find_or_create_component(WBWeb.java_class, name,
285
286
  create_options)
286
287
  @logger.debug("TorqueBox::Web::Server '{}' has component {}",
Binary file
@@ -15,17 +15,18 @@
15
15
  module WunderBoss
16
16
  module Rack
17
17
  class ResponseHandler
18
- def self.handle(rack_response, rack_responder)
18
+ def self.handle(rack_response, rack_responder, env)
19
19
  status = rack_response[0]
20
20
  headers = rack_response[1]
21
21
  body = rack_response[2]
22
22
 
23
+ raise_if_hijacked(status, env)
23
24
  begin
24
25
  rack_responder.response_code = status.to_i
25
26
 
26
27
  transfer_encoding_value = nil
27
28
  headers.each do |key, value|
28
- rack_responder.add_header(key, value)
29
+ rack_responder.add_header(key, value.to_s)
29
30
  transfer_encoding_value = value if key == 'Transfer-Encoding'
30
31
  end
31
32
 
@@ -36,7 +37,7 @@ module WunderBoss
36
37
  output = chunked ? strip_term_markers(chunk) : chunk
37
38
  unless output.nil?
38
39
  rack_responder.write(output)
39
- rack_responder.flush if chunked
40
+ rack_responder.flush
40
41
  end
41
42
  end
42
43
  rescue NativeException => e
@@ -47,6 +48,11 @@ module WunderBoss
47
48
  end
48
49
  end
49
50
 
51
+ def self.raise_if_hijacked(status, env)
52
+ hijacked = status.to_i < 0 || env["rack.hijack_io"]
53
+ raise org.projectodd.wunderboss.rack.RackHijackException.new if hijacked
54
+ end
55
+
50
56
  # TODO: remove this once we upgrade to Undertow 1.0.2.Final
51
57
  # https://issues.jboss.org/browse/UNDERTOW-133
52
58
  def self.strip_term_markers(chunk)
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: torquebox-web
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.0.0.alpha1
4
+ version: 4.0.0.beta1
5
5
  platform: java
6
6
  authors:
7
7
  - The TorqueBox Team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-04 00:00:00.000000000 Z
11
+ date: 2015-06-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -36,12 +36,12 @@ dependencies:
36
36
  requirements:
37
37
  - - '='
38
38
  - !ruby/object:Gem::Version
39
- version: 4.0.0.alpha1
39
+ version: 4.0.0.beta1
40
40
  requirement: !ruby/object:Gem::Requirement
41
41
  requirements:
42
42
  - - '='
43
43
  - !ruby/object:Gem::Version
44
- version: 4.0.0.alpha1
44
+ version: 4.0.0.beta1
45
45
  prerelease: false
46
46
  type: :runtime
47
47
  - !ruby/object:Gem::Dependency
@@ -106,24 +106,24 @@ executables: []
106
106
  extensions: []
107
107
  extra_rdoc_files: []
108
108
  files:
109
- - lib/wunderboss_rack_response_handler.rb
110
109
  - lib/wunderboss-rack.jar
111
110
  - lib/torquebox-web.rb
112
- - lib/rack/handler/torquebox.rb
113
- - lib/wunderboss-jars/sockjs-servlet-0.1.2.jar
114
- - lib/wunderboss-jars/wunderboss-web-1.x.incremental.174.jar
111
+ - lib/wunderboss_rack_response_handler.rb
112
+ - lib/wunderboss-jars/xnio-api-3.3.0.Final.jar
115
113
  - lib/wunderboss-jars/jboss-servlet-api_3.1_spec-1.0.0.Final.jar
116
- - lib/wunderboss-jars/undertow-servlet-1.1.0.Final.jar
114
+ - lib/wunderboss-jars/xnio-nio-3.3.0.Final.jar
117
115
  - lib/wunderboss-jars/jboss-annotations-api_1.2_spec-1.0.0.Final.jar
118
- - lib/wunderboss-jars/xnio-api-3.3.0.Final.jar
119
- - lib/wunderboss-jars/undertow-core-1.1.0.Final.jar
120
116
  - lib/wunderboss-jars/jboss-websocket-api_1.1_spec-1.1.0.Final.jar
121
117
  - lib/wunderboss-jars/undertow-websockets-jsr-1.1.0.Final.jar
122
- - lib/wunderboss-jars/xnio-nio-3.3.0.Final.jar
118
+ - lib/wunderboss-jars/undertow-core-1.1.0.Final.jar
119
+ - lib/wunderboss-jars/undertow-servlet-1.1.0.Final.jar
120
+ - lib/wunderboss-jars/wunderboss-web-0.8.0.jar
121
+ - lib/wunderboss-jars/sockjs-servlet-0.1.2.jar
122
+ - lib/rack/handler/torquebox.rb
123
123
  - lib/torquebox/web.rb
124
- - lib/torquebox/web/server.rb
125
124
  - lib/torquebox/web/cli.rb
126
- homepage: http://torquebox.org/torqbox
125
+ - lib/torquebox/web/server.rb
126
+ homepage: http://torquebox.org/4x
127
127
  licenses:
128
128
  - Apache-2.0
129
129
  metadata: {}
@@ -142,8 +142,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
142
142
  - !ruby/object:Gem::Version
143
143
  version: 1.3.1
144
144
  requirements:
145
- - jar org.projectodd.wunderboss:wunderboss-ruby, 1.x.incremental.174
146
- - jar org.projectodd.wunderboss:wunderboss-web, 1.x.incremental.174
145
+ - jar org.projectodd.wunderboss:wunderboss-ruby, 0.8.0
146
+ - jar org.projectodd.wunderboss:wunderboss-web, 0.8.0
147
147
  - jar org.projectodd.sockjs:sockjs-servlet, 0.1.2
148
148
  rubyforge_project:
149
149
  rubygems_version: 2.1.9