Skip to content
Browse files

[Issue #46] Added .close to response to resolve some thread locking i…

…ssues
  • Loading branch information...
1 parent acdcb25 commit 5813d14d935200cef8a12749065e803004a6a379 @jasonschock jasonschock committed Jan 4, 2012
Showing with 3 additions and 0 deletions.
  1. +3 −0 lib/rack/contrib/jsonp.rb
View
3 lib/rack/contrib/jsonp.rb
@@ -85,6 +85,9 @@ def pad(callback, response, body = "")
# a string and should therefore not be present any other places.
body << s.to_s.gsub("\u2028", '\u2028').gsub("\u2029", '\u2029')
end
+
+ # https://github.com/rack/rack-contrib/issues/46
+ response.close if response.respond_to?(:close)
["#{callback}(#{body})"]
end

0 comments on commit 5813d14

Please sign in to comment.
Something went wrong with that request. Please try again.