-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #25032: Use Content-Security-Policy strict headers in utilities…
… pages
- Loading branch information
1 parent
4ef5430
commit 4f3457b
Showing
4 changed files
with
53 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 23 additions & 0 deletions
23
...es/rudder/rudder-web/src/main/scala/com/normation/rudder/web/snippet/WithEnabledCSP.scala
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
package com.normation.rudder.web.snippet | ||
|
||
import net.liftweb.http.RequestVar | ||
import net.liftweb.http.StatefulSnippet | ||
import scala.xml.* | ||
|
||
object WithEnabledCSP extends StatefulSnippet { | ||
|
||
/** | ||
* Holder for state of strict CSP headers activation | ||
*/ | ||
private object enabled extends RequestVar[Boolean](false) {} | ||
|
||
def dispatch: PartialFunction[String, NodeSeq => NodeSeq] = _ => enable() | ||
|
||
def enable(): NodeSeq => NodeSeq = { | ||
enabled.setIfUnset(true) | ||
identity | ||
} | ||
|
||
def isEnabled: Boolean = enabled.get | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
webapp/sources/rudder/rudder-web/src/main/webapp/secure/utilities/healthcheck.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters