Add Configuration.disable! to completely disable secure_headers #568
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Users need a way to conditionally disable secure_headers entirely at runtime (e.g., per-customer deployments, gradual rollouts, or during migration from custom headers).
Changes
Configuration.disable!: Sets all headers toOPT_OUTwithout requiring default configConfiguration.disabled?: Query method for disabled statedefault_config: Returns NOOP config when disabled, bypassingNotYetConfiguredErrordisable!andNOOP_OVERRIDEUsage
When disabled, no security headers are sent. No configuration required.
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
coveralls.io/usr/bin/ruby3.2 ruby3.2 /home/REDACTED/work/secure_headers/secure_headers/vendor/bundle/ruby/3.2.0/bin/rspec spec/lib/secure_headers/configuration_spec.rb /tmp/ccit2uJh.s conf�� u/13/liblto_plug-I _64-linux-gnu/13/usr/include/ruby-3.2.0/ruby/backward ism-1.6.0/include credential.helpeas ism-1.6.0/ext(dns block)/usr/bin/ruby3.2 ruby3.2 /home/REDACTED/work/secure_headers/secure_headers/vendor/bundle/ruby/3.2.0/bin/rspec spec/lib/secure_headers/configuration_spec.rb -I ec -I /home/REDACTED/work/secure_headers/secure_headers/vendor/bundle/ruby/3.2.0/gems/prism-1.6.0/ext --gdwarf-5 --64 -o static_literals.o /tmp/ccvc1OZl.s conf�� by-3.2.0 --global by/3.2.0/gems/pr-I user.email by/3.2.0/gems/prcompiling(dns block)/usr/bin/ruby3.2 ruby3.2 /home/REDACTED/work/secure_headers/secure_headers/vendor/bundle/ruby/3.2.0/bin/rspec spec/lib/secure_headers_spec.rb -collect-logs conf�� by-3.2.0 /src/ruby3.2-3.2/usr/include/ruby-3.2.0/ruby/backward u/13/collect2 credential.helpeas(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.