Skip to content

Commit 6a78f95

Browse files
Copilotfletchto99
andcommitted
Document that disable!/default must be set at startup
Clarify in README that Configuration.disable! and Configuration.default must be called during application startup and cannot be changed at runtime. Co-authored-by: fletchto99 <[email protected]>
1 parent ccae709 commit 6a78f95

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,8 @@ else
139139
end
140140
```
141141

142+
**Important**: This configuration must be set during application startup (e.g., in an initializer). Once you call either `Configuration.default` or `Configuration.disable!`, the choice cannot be changed at runtime. Attempting to call `disable!` after `default` (or vice versa) will raise an `AlreadyConfiguredError`.
143+
142144
When disabled, no security headers will be set by the gem. This is useful when:
143145
- You're gradually rolling out secure_headers across different customers or deployments
144146
- You need to migrate existing custom headers to secure_headers

0 commit comments

Comments
 (0)