Followup to #41, allow those values anyways
This commit is contained in:
Родитель
73cac635c3
Коммит
d641975eb3
|
@ -38,7 +38,7 @@ module SecureHeaders
|
|||
if !@config[:value]
|
||||
raise XXssProtectionBuildError.new(":value key is missing")
|
||||
elsif @config[:value]
|
||||
unless [0,1].include?(@config[:value])
|
||||
unless [0,1].include?(@config[:value].to_i)
|
||||
raise XXssProtectionBuildError.new(":value must be 1 or 0")
|
||||
end
|
||||
|
||||
|
|
|
@ -17,6 +17,18 @@ module SecureHeaders
|
|||
end
|
||||
|
||||
context "when using a hash value" do
|
||||
it "should allow string values ('1' or '0' are the only valid strings)" do
|
||||
lambda {
|
||||
XXssProtection.new(:value => '1')
|
||||
}.should_not raise_error
|
||||
end
|
||||
|
||||
it "should allow integer values (1 or 0 are the only valid integers)" do
|
||||
lambda {
|
||||
XXssProtection.new(:value => 1)
|
||||
}.should_not raise_error
|
||||
end
|
||||
|
||||
it "should raise an error if no value key is supplied" do
|
||||
lambda {
|
||||
XXssProtection.new(:mode => 'block')
|
||||
|
|
Загрузка…
Ссылка в новой задаче