From 301e01d8b579a534b903555d97d2a06b4435b53e Mon Sep 17 00:00:00 2001
From: Eric Lawrence <ericlaw@microsoft.com>
Date: Sun, 8 May 2022 04:06:23 +0000
Subject: [PATCH] Fix typo in CSP error message

The word |explicitly| was misspelt |explicitely| in a console error
message. Fix that.

Change-Id: Ia9740cba01eac1fda795f0ec7a35e166ad6cb1ce
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3632484
Commit-Queue: Eric Lawrence <ericlaw@microsoft.com>
Reviewed-by: Arthur Sonzogni <arthursonzogni@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1000767}
---
 content/browser/content_security_policy_browsertest.cc      | 6 ++++--
 .../cpp/content_security_policy/content_security_policy.cc  | 4 ++--
 .../cpp/content_security_policy/csp_context_unittest.cc     | 3 ++-
 .../blink/renderer/core/frame/csp/csp_directive_list.cc     | 4 ++--
 4 files changed, 10 insertions(+), 7 deletions(-)

diff --git a/content/browser/content_security_policy_browsertest.cc b/content/browser/content_security_policy_browsertest.cc
index 03fe259058408..a86e361248982 100644
--- a/content/browser/content_security_policy_browsertest.cc
+++ b/content/browser/content_security_policy_browsertest.cc
@@ -115,7 +115,8 @@ IN_PROC_BROWSER_TEST_F(ContentSecurityPolicyBrowserTest,
       "Refused to frame '' because it violates the following Content Security "
       "Policy directive: \"frame-src *\". Note that '*' matches only URLs with "
       "network schemes ('http', 'https', 'ws', 'wss'), or URLs whose scheme "
-      "matches `self`'s scheme. mailto:' must be added explicitely.\n");
+      "matches `self`'s scheme. The scheme 'mailto:' must be added "
+      "explicitly.\n");
   EXPECT_TRUE(NavigateToURL(shell(), url));
   console_observer.Wait();
 }
@@ -136,7 +137,8 @@ IN_PROC_BROWSER_TEST_F(ContentSecurityPolicyBrowserTest,
       "\"script-src *\". Note that 'script-src-elem' was not explicitly set, "
       "so 'script-src' is used as a fallback. Note that '*' matches only URLs "
       "with network schemes ('http', 'https', 'ws', 'wss'), or URLs whose "
-      "scheme matches `self`'s scheme. mailto:' must be added explicitely.\n");
+      "scheme matches `self`'s scheme. The scheme 'mailto:' must be added "
+      "explicitly.\n");
   EXPECT_TRUE(NavigateToURL(shell(), url));
   console_observer.Wait();
 }
diff --git a/services/network/public/cpp/content_security_policy/content_security_policy.cc b/services/network/public/cpp/content_security_policy/content_security_policy.cc
index 8cc7a856bb43f..4659636dac9a1 100644
--- a/services/network/public/cpp/content_security_policy/content_security_policy.cc
+++ b/services/network/public/cpp/content_security_policy/content_security_policy.cc
@@ -233,8 +233,8 @@ void ReportViolation(CSPContext* context,
   if (policy->directives[effective_directive_name]->allow_star) {
     message << " Note that '*' matches only URLs with network schemes ('http', "
                "'https', 'ws', 'wss'), or URLs whose scheme matches `self`'s "
-               "scheme. "
-            << blocked_url_scheme << ":' must be added explicitely.";
+               "scheme. The scheme '"
+            << blocked_url_scheme << ":' must be added explicitly.";
   }
 
   message << "\n";
diff --git a/services/network/public/cpp/content_security_policy/csp_context_unittest.cc b/services/network/public/cpp/content_security_policy/csp_context_unittest.cc
index 9043c45f073de..98671bc149ebf 100644
--- a/services/network/public/cpp/content_security_policy/csp_context_unittest.cc
+++ b/services/network/public/cpp/content_security_policy/csp_context_unittest.cc
@@ -352,7 +352,8 @@ TEST(CSPContextTest, BlockedDespiteWildcard) {
             "violates the following Content Security Policy directive: "
             "\"frame-src *\". Note that '*' matches only URLs with network "
             "schemes ('http', 'https', 'ws', 'wss'), or URLs whose scheme "
-            "matches `self`'s scheme. data:' must be added explicitely.\n");
+            "matches `self`'s scheme. The scheme 'data:' must be added "
+            "explicitly.\n");
 }
 
 }  // namespace network
diff --git a/third_party/blink/renderer/core/frame/csp/csp_directive_list.cc b/third_party/blink/renderer/core/frame/csp/csp_directive_list.cc
index a989dea8c0bf0..dbd38a07a41fc 100644
--- a/third_party/blink/renderer/core/frame/csp/csp_directive_list.cc
+++ b/third_party/blink/renderer/core/frame/csp/csp_directive_list.cc
@@ -614,8 +614,8 @@ bool CheckSourceAndReportViolation(
     suffix = suffix +
              " Note that '*' matches only URLs with network schemes ('http', "
              "'https', 'ws', 'wss'), or URLs whose scheme matches `self`'s "
-             "scheme. " +
-             url.Protocol() + ":' must be added explicitely.";
+             "scheme. The scheme '" +
+             url.Protocol() + ":' must be added explicitly.";
   }
 
   String raw_directive =