Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
add meta refresh/redirect obstacle to the course
  • Loading branch information
zapnap committed Jun 27, 2010
1 parent d8282b3 commit 2e9149f
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 0 deletions.
6 changes: 6 additions & 0 deletions lib/wsoc/app.rb
Expand Up @@ -113,6 +113,12 @@ class App < Sinatra::Base

course_pass '/course/redirects/307/pass.html'

get '/course/redirects/meta.html' do
course_page :course_redirects_meta
end

course_pass '/course/redirects/meta/pass.html'

get '/course/cookies/start.html' do
response.set_cookie 'auth_level', '1'

Expand Down
4 changes: 4 additions & 0 deletions lib/wsoc/course_specs.rb
Expand Up @@ -125,6 +125,10 @@ module CourseSpecs
'should visit the 307 HTTP redirect test page'
should_visit '/course/redirects/307/pass.html',
'should follow HTTP 307 redirects'
should_visit '/course/redirects/meta.html',
'should visit the meta refresh redirect test page'
should_visit '/course/redirects/meta/pass.html',
'should follow meta refresh (soft) redirects'

config :auth_store, {
'/course/auth/' => {
Expand Down
8 changes: 8 additions & 0 deletions views/course_redirects_meta.erb
@@ -0,0 +1,8 @@
<html>
<head>
<meta http-equiv="refresh" content="2; url=/course/redirects/meta/pass.html">
</head>
<body>
Redirecting...
</body>
</html>
1 change: 1 addition & 0 deletions views/course_redirects_start.erb
Expand Up @@ -12,6 +12,7 @@
<li><a href="302.html">HTTP 302 Redirect</a></li>
<li><a href="303.html">HTTP 303 Redirect</a></li>
<li><a href="307.html">HTTP 307 Redirect</a></li>
<li><a href="meta.html">Meta Refresh "Soft" Redirect</a></li>
</ul>
</body>
</html>

0 comments on commit 2e9149f

Please sign in to comment.