mirror of
https://github.com/hakanensari/frankfurter.git
synced 2024-11-21 18:42:29 +01:00
Add cache-control header to response
This commit is contained in:
parent
9c974df575
commit
6e09acc767
@ -34,6 +34,8 @@ module Web
|
|||||||
plugin :params_capturing
|
plugin :params_capturing
|
||||||
|
|
||||||
route do |r|
|
route do |r|
|
||||||
|
response.cache_control public: true, max_age: 900
|
||||||
|
|
||||||
r.root do
|
r.root do
|
||||||
{ docs: 'https://www.frankfurter.app/docs' }
|
{ docs: 'https://www.frankfurter.app/docs' }
|
||||||
end
|
end
|
||||||
|
@ -56,6 +56,13 @@ describe 'the server' do
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
it 'returns a cache control header' do
|
||||||
|
%w[/latest /2012-11-20].each do |path|
|
||||||
|
get path
|
||||||
|
_(headers['Cache-Control']).wont_be_nil
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
it 'allows cross-origin requests' do
|
it 'allows cross-origin requests' do
|
||||||
%w[/ /latest /2012-11-20].each do |path|
|
%w[/ /latest /2012-11-20].each do |path|
|
||||||
header 'Origin', '*'
|
header 'Origin', '*'
|
||||||
|
Loading…
Reference in New Issue
Block a user