Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions lib/resque_cleaner/server/views/cleaner_list.erb
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@
<div class="clearfix">
<div class="control_panel sub_header">
<form method="post" id="exec" action="cleaner_exec">
<input type="hidden" name="c" value="<%=@klass%>" />
<input type="hidden" name="f" value="<%=@from%>" />
<input type="hidden" name="t" value="<%=@to%>" />
<input type="hidden" name="p" value="<%=@paginate.page%>" />
<input type="hidden" name="ex" value="<%=@exception%>" />
<input type="hidden" name="c" value="<%= h @klass %>" />
<input type="hidden" name="f" value="<%= h @from %>" />
<input type="hidden" name="t" value="<%= h @to %>" />
<input type="hidden" name="p" value="<%= h @paginate.page %>" />
<input type="hidden" name="ex" value="<%= h @exception %>" />
<input type="hidden" name="regex" value="<%=Rack::Utils.escape_html(@regex)%>" />
<select id="form_action" name="action">
<option id="default_option" value="" selected="selected">-- Select Action --</option>
Expand Down
9 changes: 7 additions & 2 deletions test/resque_web_test.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,17 @@ def setup_some_failed_jobs
assert last_response.body.include?('"BadJobWithSyntaxError"')
assert last_response.body.include?('"BadJob"')
end



it "#cleaner_list shows escaped XSS attempt" do
get "/cleaner_list?t=%22%3e%3cscript%3ealert(document.cookie)%3c%2fscript%3e"
assert last_response.body.include?('&quot;&gt;&lt;script&gt;alert(document.cookie)&lt;&#x2F;script&gt;')
end

it '#cleaner_exec clears job' do
post "/cleaner_exec", :action => "clear", :sha1 => Digest::SHA1.hexdigest(@cleaner.select[0].to_json)
assert_equal 10, @cleaner.select.size
end

it "#cleaner_dump should respond with success" do
get "/cleaner_dump"
assert last_response.ok?, last_response.errors
Expand Down