Skip to content

Commit

Permalink
Whitespace
Browse files Browse the repository at this point in the history
  • Loading branch information
chrisdurtschi committed Aug 22, 2010
1 parent ca0ae7b commit 3c1e971
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion lib/rack/sanitize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class Sanitize
def initialize(app)
@app = app
end

def call(env)
request = Rack::Request.new(env)
request.GET.each {|k,v| request.GET[k] = ::Sanitize.clean(v)}
Expand Down
14 changes: 7 additions & 7 deletions spec/rack/sanitize.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,21 +5,21 @@
get '/get', {"a" => "ok", "okie" => %Q{<script src="http://iammalicious.com">dokie</script>}}
last_response.body.should == "GETs: a=ok&okie=dokie"
end

it "should sanitize POSTs" do
post '/post', {"a" => "ok", "okie" => %Q{<script src="http://iammalicious.com">dokie</script>}}
last_response.body.should == "POSTs: a=ok&okie=dokie"
end

it "should sanitize if the path matches" do

end

it "should not sanitize if the path does not match" do

end

it "should default to sanitizing both GETs and POSTs" do

end
end
6 changes: 3 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,19 @@ def render_key_value(hash)
hash.map {|k,v| "#{k}=#{v}"}.sort.join('&')
end
end

get '/get' do
"GETs: #{render_key_value(request.GET)}"
end

post '/post' do
"POSTs: #{render_key_value(request.POST)}"
end
end

Spec::Runner.configure do |config|
config.include Rack::Test::Methods

def app
@app ||= Rack::Builder.app do
use Rack::Sanitize
Expand Down

0 comments on commit 3c1e971

Please sign in to comment.