wonki 0.0.5 → 0.0.6
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/lib/wonki/wiki_page.rb +1 -0
- data/test/wiki_page_test.rb +4 -0
- data/wonki.gemspec +1 -1
- metadata +1 -1
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.6
|
data/lib/wonki/wiki_page.rb
CHANGED
@@ -23,6 +23,7 @@ module Wonki
|
|
23
23
|
response_body = git_data[:content]
|
24
24
|
headers["Last-Modified"] = git_data[:last_modified].httpdate
|
25
25
|
headers["Etag"] = Digest::MD5.hexdigest(git_data[:content])
|
26
|
+
headers["Cache-Control"] = "max-age=300, public"
|
26
27
|
status = 200
|
27
28
|
rescue Wonki::PageNotFound
|
28
29
|
response_body = "Page Not Found"
|
data/test/wiki_page_test.rb
CHANGED
@@ -28,6 +28,10 @@ class WikiPageTest < Test::Unit::TestCase
|
|
28
28
|
should "set etag" do
|
29
29
|
assert_not_nil @headers['Etag']
|
30
30
|
end
|
31
|
+
|
32
|
+
should "set cache control" do
|
33
|
+
assert_equal(@headers["Cache-Control"], "max-age=300, public")
|
34
|
+
end
|
31
35
|
end
|
32
36
|
|
33
37
|
context "PageNotFound" do
|
data/wonki.gemspec
CHANGED