lib/angelo/responder.rb in angelo-0.1.11 vs lib/angelo/responder.rb in angelo-0.1.12
- old
+ new
@@ -53,11 +53,11 @@
end
def handle_request
if @response_handler
@base.before if @base.respond_to? :before
- @body = catch(:halt) { @response_handler.bind(@base).call || '' }
+ @body = catch(:halt) { @response_handler.bind(@base).call || EMPTY_STRING }
@base.after if @base.respond_to? :after
respond
else
raise NotImplementedError
end
@@ -106,9 +106,11 @@
case type
when :json
headers CONTENT_TYPE_HEADER_KEY => JSON_TYPE
when :html
headers CONTENT_TYPE_HEADER_KEY => HTML_TYPE
+ when :js
+ headers CONTENT_TYPE_HEADER_KEY => JS_TYPE
else
raise ArgumentError.new "invalid content_type: #{type}"
end
end