You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
HTTP/1.1 200 OK
Content-Type: application/json;charset=utf-8
Content-Length: 3546
X-Content-Type-Options: nosniff
Server: WEBrick/1.3.1 (Ruby/2.0.0/2013-06-27)
Date: Thu, 17 Oct 2013 02:38:24 GMT
Enable Cache
$ vi app/app.rb
module Sample
class App < Padrino::Application
#### Caching support.#
register Padrino::Cache
enable :caching
end
end
$ vi app/controllers/index.rb
require 'json'
Sample::App.controllers :index do
get :index, :provides=>:json, :cache=>true do
JSON.pretty_generate($LOAD_PATH)
end
end
Padrino log message & HTTP Response Header from Padrino for 1st access
$ vi Gemfile
# Use ":git" directive because my PC is behind proxy that does not allow git protocol.
# Padrino Stable Gem
#gem 'padrino', '0.11.4'
# Or Padrino Edge
#gem 'padrino', :github => 'padrino/padrino-framework'
gem 'padrino', :git => 'http://github.com/padrino/padrino-framework'
$ bundle update
$ bundle exec padrino start
-> Completely same result as v0.11.4
The text was updated successfully, but these errors were encountered:
As mentioned in issue #745, current padrino returns "text/html" content-type regardless of the controller directive.
I've tried to reproduce this problem as following.
Confirm Ruby & Padrino Version
Create Project & Setup Sample App
Confirm JSON Output
Output of http://localhost:3000/index
HTTP Response Header from Padrino
Enable Cache
Padrino log message & HTTP Response Header from Padrino for 1st access
exec
bundle exec padrino start
and access "http://localhost:3000/index".Padrino log message & HTTP Response Header from Padrino for 2nd access
Use Padrino Edge
-> Completely same result as v0.11.4
The text was updated successfully, but these errors were encountered: