falcon 0.4.2 → 0.5.0

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: 58f450dc6e553fb95a5f00e8a6a324cdd7307ea5
4
- data.tar.gz: a543cf863916d2b2cbbe5f411eab7dd2879d0447
3
+ metadata.gz: ffde5c3cd28c595389deccb1c4252be6d08b1de3
4
+ data.tar.gz: 34a3af82b5e312e0c942142aab09401f1ad3335e
5
5
  SHA512:
6
- metadata.gz: 72c3e70bd529b3bbd41b80e046c82e24ced2d2243656b35f94658b141ca98a0f8a26f9f75319e488b8485ee41d2e3922da3c926a557cd238f7028dd052be60bf
7
- data.tar.gz: b1d000e4c04c8adb80519aba8d646e535c2fcacb9f84c31f492e170a695d93be6c8b7a29a66a12bdad5d9300b3e8ee1f7175133d20dfd79f4f8ee76358e0a3c7
6
+ metadata.gz: 41f5be797dffbb54206cef86258b25efee38913270099c32b72dcdb02fea16f5add4b1a2c9b6e5291aef33171351863e1dd1f01f9801858079b117abe0d869f6
7
+ data.tar.gz: 1dfe0c9e4097c51029592fbd5b351c3ccb98d1d557205587bafb18834e737ea308c8e88162aebc484cf6927e339fd62fcd50ab155eef9402c03acf2176a4b68d
data/lib/falcon/server.rb CHANGED
@@ -70,6 +70,11 @@ module Falcon
70
70
  'SERVER_PORT' => server_port || '',
71
71
  }.merge(request.headers)
72
72
 
73
+ env['rack.hijack?'] = true
74
+ env['rack.hijack'] = lambda do
75
+ env['rack.hijack_io'] = peer
76
+ end
77
+
73
78
  if content_type = request.headers['HTTP_CONTENT_TYPE']
74
79
  env['CONTENT_TYPE'] = content_type
75
80
  end
@@ -78,7 +83,13 @@ module Falcon
78
83
  env['REMOTE_ADDR'] = remote_address.ip_address if remote_address.ip?
79
84
  end
80
85
 
81
- return @app.call(env)
86
+ response = @app.call(env)
87
+
88
+ if env['rack.hijack_io']
89
+ throw :hijack
90
+ else
91
+ return response
92
+ end
82
93
  rescue => exception
83
94
  logger.error "#{exception.class}: #{exception.message}\n\t#{$!.backtrace.join("\n\t")}"
84
95
 
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Falcon
22
- VERSION = "0.4.2"
22
+ VERSION = "0.5.0"
23
23
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: falcon
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.2
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-21 00:00:00.000000000 Z
11
+ date: 2018-01-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: async-http