Set 'Expires' header to 0 for all responses
This commit is contained in:
parent
a559f55a6d
commit
5ddde402a8
@ -46,6 +46,7 @@ class LiquorCabinet < Sinatra::Base
|
||||
'Access-Control-Expose-Headers' => 'ETag'
|
||||
headers['Access-Control-Allow-Origin'] = env["HTTP_ORIGIN"] if env["HTTP_ORIGIN"]
|
||||
headers['Cache-Control'] = 'no-cache'
|
||||
headers['Expires'] = 0
|
||||
|
||||
@user, @key = params[:user], params[:key]
|
||||
@directory = params[:splat] && params[:splat].first || ""
|
||||
|
||||
@ -67,6 +67,13 @@ describe "Directories" do
|
||||
last_response.headers["Access-Control-Expose-Headers"].must_equal "ETag"
|
||||
end
|
||||
|
||||
it "has caching headers set" do
|
||||
get "/jimmy/tasks/"
|
||||
|
||||
last_response.status.must_equal 200
|
||||
last_response.headers["Expires"].must_equal 0
|
||||
end
|
||||
|
||||
context "when If-None-Match header is set" do
|
||||
before do
|
||||
get "/jimmy/tasks/"
|
||||
|
||||
@ -37,6 +37,11 @@ describe "App with Riak backend" do
|
||||
last_response.status.must_equal 200
|
||||
last_response.headers["ETag"].wont_be_nil
|
||||
end
|
||||
|
||||
it "has caching headers set" do
|
||||
last_response.status.must_equal 200
|
||||
last_response.headers["Expires"].must_equal 0
|
||||
end
|
||||
end
|
||||
|
||||
describe "GET data with custom content type" do
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user