<video> and x-sendfile
Using <object> and <embed> were forbidden for obvious security reasons. Instiki now permits embedding video via the HTML5 <video> element (Ogg/Theora encoded videos only, with .ogg or .ogv extensions). You can even upload videos with [[foo.ogg:video]] Instiki now support x-sendfile. See the Proxying page for configuring Apache (with the x-sendfile module). Lighttpd should work similarly. Update Rails to latest Edge (hopefully converging on RC2!).
This commit is contained in:
parent
133c21b801
commit
8ea8b6a8f7
45 changed files with 872 additions and 751 deletions
|
@ -36,6 +36,39 @@ class TestController < ActionController::Base
|
|||
render :action => 'hello_world'
|
||||
end
|
||||
end
|
||||
|
||||
def conditional_hello_with_public_header
|
||||
if stale?(:last_modified => Time.now.utc.beginning_of_day, :etag => [:foo, 123], :public => true)
|
||||
render :action => 'hello_world'
|
||||
end
|
||||
end
|
||||
|
||||
def conditional_hello_with_public_header_and_expires_at
|
||||
expires_in 1.minute
|
||||
if stale?(:last_modified => Time.now.utc.beginning_of_day, :etag => [:foo, 123], :public => true)
|
||||
render :action => 'hello_world'
|
||||
end
|
||||
end
|
||||
|
||||
def conditional_hello_with_expires_in
|
||||
expires_in 1.minute
|
||||
render :action => 'hello_world'
|
||||
end
|
||||
|
||||
def conditional_hello_with_expires_in_with_public
|
||||
expires_in 1.minute, :public => true
|
||||
render :action => 'hello_world'
|
||||
end
|
||||
|
||||
def conditional_hello_with_expires_in_with_public_with_more_keys
|
||||
expires_in 1.minute, :public => true, 'max-stale' => 5.hours
|
||||
render :action => 'hello_world'
|
||||
end
|
||||
|
||||
def conditional_hello_with_expires_in_with_public_with_more_keys_old_syntax
|
||||
expires_in 1.minute, :public => true, :private => nil, 'max-stale' => 5.hours
|
||||
render :action => 'hello_world'
|
||||
end
|
||||
|
||||
def conditional_hello_with_bangs
|
||||
render :action => 'hello_world'
|
||||
|
@ -1464,6 +1497,35 @@ class RenderTest < ActionController::TestCase
|
|||
end
|
||||
end
|
||||
|
||||
class ExpiresInRenderTest < ActionController::TestCase
|
||||
tests TestController
|
||||
|
||||
def setup
|
||||
@request.host = "www.nextangle.com"
|
||||
end
|
||||
|
||||
def test_expires_in_header
|
||||
get :conditional_hello_with_expires_in
|
||||
assert_equal "max-age=60, private", @response.headers["Cache-Control"]
|
||||
end
|
||||
|
||||
def test_expires_in_header
|
||||
get :conditional_hello_with_expires_in_with_public
|
||||
assert_equal "max-age=60, public", @response.headers["Cache-Control"]
|
||||
end
|
||||
|
||||
def test_expires_in_header_with_additional_headers
|
||||
get :conditional_hello_with_expires_in_with_public_with_more_keys
|
||||
assert_equal "max-age=60, public, max-stale=18000", @response.headers["Cache-Control"]
|
||||
end
|
||||
|
||||
def test_expires_in_old_syntax
|
||||
get :conditional_hello_with_expires_in_with_public_with_more_keys_old_syntax
|
||||
assert_equal "max-age=60, public, max-stale=18000", @response.headers["Cache-Control"]
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
class EtagRenderTest < ActionController::TestCase
|
||||
tests TestController
|
||||
|
||||
|
@ -1553,6 +1615,16 @@ class EtagRenderTest < ActionController::TestCase
|
|||
get :conditional_hello_with_bangs
|
||||
assert_response :not_modified
|
||||
end
|
||||
|
||||
def test_etag_with_public_true_should_set_header
|
||||
get :conditional_hello_with_public_header
|
||||
assert_equal "public", @response.headers['Cache-Control']
|
||||
end
|
||||
|
||||
def test_etag_with_public_true_should_set_header_and_retain_other_headers
|
||||
get :conditional_hello_with_public_header_and_expires_at
|
||||
assert_equal "max-age=60, public", @response.headers['Cache-Control']
|
||||
end
|
||||
|
||||
protected
|
||||
def etag_for(text)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue