You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* Raise exception when trying to override an existing config
* Raise exception when trying to set a named append more than once
* Update documentation
* Raise an exception when a named append or override with the same name exists
Co-authored-by: Neil Matatall <448516+oreoshake@users.noreply.github.com>
Copy file name to clipboardExpand all lines: docs/named_overrides_and_appends.md
+3-1Lines changed: 3 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
## Named Appends
2
2
3
-
Named Appends are blocks of code that can be reused and composed during requests. e.g. If a certain partial is rendered conditionally, and the csp needs to be adjusted for that partial, you can create a named append for that situation. The value returned by the block will be passed into `append_content_security_policy_directives`. The current request object is passed as an argument to the block for even more flexibility.
3
+
Named Appends are blocks of code that can be reused and composed during requests. e.g. If a certain partial is rendered conditionally, and the csp needs to be adjusted for that partial, you can create a named append for that situation. The value returned by the block will be passed into `append_content_security_policy_directives`. The current request object is passed as an argument to the block for even more flexibility. Reusing a configuration name is not allowed and will throw an exception.
4
4
5
5
```ruby
6
6
defshow
@@ -91,6 +91,8 @@ class MyController < ApplicationController
91
91
end
92
92
```
93
93
94
+
Reusing a configuration name is not allowed and will throw an exception.
95
+
94
96
By default, a no-op configuration is provided. No headers will be set when this default override is used.
0 commit comments