From abfd70ff77791d2fa2de6a293dbf3b4e532963d1 Mon Sep 17 00:00:00 2001 From: Ian Melven Date: Wed, 9 Jan 2013 10:57:05 -0800 Subject: [PATCH] Bug 746978 - sync CSP directive parsing and directive names with w3c CSP 1.0 spec - part 6 - fix up toString (r=sstamm) --- content/base/src/CSPUtils.jsm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/content/base/src/CSPUtils.jsm b/content/base/src/CSPUtils.jsm index 713c8cb9f197..7631a7549668 100644 --- a/content/base/src/CSPUtils.jsm +++ b/content/base/src/CSPUtils.jsm @@ -712,7 +712,7 @@ CSPRep.prototype = { function csp_toString() { var dirs = []; - if (this._allowEval || this._allowInlineScripts) { + if (!this._specCompliant && (this._allowEval || this._allowInlineScripts)) { dirs.push("options" + (this._allowEval ? " eval-script" : "") + (this._allowInlineScripts ? " inline-script" : "")); } @@ -1492,6 +1492,12 @@ CSPSource.prototype = { if (this._isSelf) return this._self.toString(); + if (this._allowUnsafeInline) + return "unsafe-inline"; + + if (this._allowUnsafeEval) + return "unsafe-eval"; + var s = ""; if (this.scheme) s = s + this.scheme + "://";