Skip to content

Commit

Permalink
set a more lenient img-src
Browse files Browse the repository at this point in the history
  • Loading branch information
oreoshake committed Jul 18, 2017
1 parent 3e3f99c commit 17a1677
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions lib/secure_headers/headers/policy_management.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ def self.included(base)
DEFAULT_VALUE = "default-src https:".freeze
DEFAULT_CONFIG = {
default_src: %w(https:),
img_src: %w(https: data: 'self'),
object_src: %w('none'),
script_src: %w(https:),
style_src: %w('self' 'unsafe-inline' https:),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ module SecureHeaders

describe "#value" do
it "uses a safe but non-breaking default value" do
expect(ContentSecurityPolicy.new.value).to eq("default-src https:; form-action 'self'; object-src 'none'; script-src https:; style-src 'self' 'unsafe-inline' https:")
expect(ContentSecurityPolicy.new.value).to eq("default-src https:; form-action 'self'; img-src https: data: 'self'; object-src 'none'; script-src https:; style-src 'self' 'unsafe-inline' https:")
end

it "discards 'none' values if any other source expressions are present" do
Expand Down

0 comments on commit 17a1677

Please sign in to comment.