Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions lib/newark/app.rb
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,11 @@ def params
request.params
end

def redirect_to path
@response.status=302
headers['Location']=path
''
end
def route
route = match_route

Expand Down
1 change: 1 addition & 0 deletions lib/newark/response.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ class Response < Rack::Response

def body=(value)
value = if value.respond_to?(:to_str)
header["Content-Type"] = "text/html;charset=utf8" if nil == headers["Content-Type"]
[ value.to_str ]
elsif value.respond_to?(:to_hash) && defined?(MultiJson)
header['Content-Type'] = JSON_MIME_TYPE
Expand Down