Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

setStatus takes an int

  • Loading branch information...
commit dd4a9864a0a1e8c41171f0250be191e616fd4f3f 1 parent 3434ff7
@pjhyett pjhyett authored
Showing with 6 additions and 6 deletions.
  1. +6 −6 lib/mizuno/rack_servlet.rb
View
12 lib/mizuno/rack_servlet.rb
@@ -30,7 +30,7 @@ def rackup(app)
# out.
#
# Also, we implement a common extension to the Rack api for
- # asynchronous request processing. We supply an 'async.callback'
+ # asynchronous request processing. We supply an 'async.callback'
# parameter in env to the Rack application. If we catch an
# :async symbol thrown by the app, we initiate a Jetty continuation.
#
@@ -50,7 +50,7 @@ def service(request, response)
# We should never be re-dispatched.
raise("Request re-dispatched.") unless continuation.isInitial
- # Add our own special bits to the rack environment so that
+ # Add our own special bits to the rack environment so that
# Rack middleware can have access to the Java internals.
env['rack.java.servlet'] = true
env['rack.java.servlet.request'] = request
@@ -68,7 +68,7 @@ def service(request, response)
# Execute the Rack request.
catch(:async) do
rack_response = @app.call(env)
-
+
# For apps that don't throw :async.
unless(rack_response[0] == -1)
# Nope, nothing asynchronous here.
@@ -150,7 +150,7 @@ def servlet_to_rack(request)
# false otherwise.
#
# Note that keep-alive *only* happens if we get either a pathname
- # (because we can find the length ourselves), or if we get a
+ # (because we can find the length ourselves), or if we get a
# Content-Length header as part of the response. While we can
# readily buffer the response object to figure out how long it is,
# we have no guarantee that we aren't going to be buffering
@@ -168,11 +168,11 @@ def rack_to_servlet(rack_response, response)
body.respond_to?(:empty?) and body.empty?)
return(true) if (finished and response.isCommitted)
- # No need to send headers again if we've already shipped
+ # No need to send headers again if we've already shipped
# data out on an async request.
unless(response.isCommitted)
# Set the HTTP status code.
- response.setStatus(status)
+ response.setStatus(status.to_i)
# Did we get a Content-Length header?
content_length = headers.delete('Content-Length')
Please sign in to comment.
Something went wrong with that request. Please try again.