Skip to content

Commit

Permalink
Merge pull request #1 from mbarnach/master
Browse files Browse the repository at this point in the history
Add 'require-trusted-types-for'
  • Loading branch information
cak authored Mar 10, 2020
2 parents 813180e + 4d4f327 commit 8e48aca
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/Koba/Directives.swift
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,11 @@ public class CSP {
return self
}

public func requireTrustedTypesFor(_ values: String...) -> CSP {
directives.append("require-trusted-types-for \(values.joined(separator: " "))")
return self
}

public func reportTo(_ reportTo: ReportTo...) -> CSP {
var reporting: [String] = []
_ = reportTo.map { report in
Expand Down
1 change: 1 addition & 0 deletions Sources/Koba/Utils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ extension Koba {
public static let strictDynamic = "'strict-dynamic'"
public static let unsafeEval = "'unsafe-eval'"
public static let unsafeInline = "'unsafe-inline'"
public static let script = "'script'"
public static let wildcard = "*"
}

Expand Down

0 comments on commit 8e48aca

Please sign in to comment.