summary refs log tree commit
path: root/lib/rack/utils.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/rack/utils.rb')
-rw-r--r--lib/rack/utils.rb8
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/rack/utils.rb b/lib/rack/utils.rb
index 333d8bf5..68fd6ace 100644
--- a/lib/rack/utils.rb
+++ b/lib/rack/utils.rb
@@ -399,6 +399,14 @@ module Rack
       hash
     }
 
+    def status_code(status)
+      if status.is_a?(Symbol)
+        SYMBOL_TO_STATUS_CODE[status] || 500
+      else
+        status.to_i
+      end
+    end
+    module_function :status_code
 
     # A multipart form data parser, adapted from IOWA.
     #