lib/falcon/adapters/rack.rb in falcon-0.37.3 vs lib/falcon/adapters/rack.rb in falcon-0.38.0

- old
+ new

@@ -58,10 +58,14 @@ RACK_URL_SCHEME = 'rack.url_scheme' RACK_HIJACK = 'rack.hijack' RACK_IS_HIJACK = 'rack.hijack?' RACK_HIJACK_IO = 'rack.hijack_io' + # Raised back up through the middleware when the underlying connection is hijacked. + class FullHijack < StandardError + end + # Async::HTTP specific metadata: ASYNC_HTTP_REQUEST = "async.http.request" # Header constants: @@ -200,10 +204,10 @@ status, headers, body = @app.call(env) # If there was a full hijack: if full_hijack - return nil + raise FullHijack, "The connection was hijacked." else return Response.wrap(status, headers, body, request) end rescue => exception @logger.error(self) {exception}