Repository: shapesecurity/salvation
Pull request #246 (2021-05-19 00:12:18)

fix: Typo on "been"
Change "has ben" to "has been".

Signed-off-by: kingthorin <kingthorin@users.noreply.github.com>

kingthorin: Ping @michaelficarra @bakkot 🙂
michaelficarra: Unfortunately our CI setup with Travis seems to be broken, and I don't have the time to fix it right now.
kingthorin: Okay, thanks for following up.
kingthorin: Is there something I can do to help keep this project alive?
michaelficarra: @kingthorin The project is alive and is being used in critical production systems in @shapesecurity (and its customers, which include major banks, airlines, hotels, etc). If there is a bug, it will be fixed. New features will be added as needed. But for a typo, it's not worth it right now for me to figure out some issue with the Travis CI integration. Eventually, we will address that issue (probably by ditching Travis for GH Actions) and merge your PR. Thanks for the contribution and sorry for the delay.
kingthorin: No no, it’s all good. I wasn’t thinking solely of this little agreeably lame PR, but some of the other issues in the tracker etc. I’m glad to hear it is used elsewhere, I was kinda wondering if ZAP was a one off.

Thanks for staying in-touch and please do let me know if there’s something I can do to help.
kingthorin: I’ll rebase this shortly so that it picks up the new CI changes.
kingthorin: Hmmm it merged instead of rebasing 😞 Will get it sorted soon.
bakkot: > Hmmm it merged instead of rebasing 😞 Will get it sorted soon.

Don't worry about it; the squash-and-merge button will create a single commit on the main branch even if there's merge commits on this branch.

Also it'll need another update to pick up https://github.com/shapesecurity/salvation/pull/252 anyway.
kingthorin: Okay I’ll watch for 252 to be merged, thanks again!

After this is all sorted I’ll tackle some minor issue that SonarLint detects. Then I’m thinking of looking into handling trusted types.

Patch:
diff --git a/src/main/java/com/shapesecurity/salvation2/Policy.java b/src/main/java/com/shapesecurity/salvation2/Policy.java
index 2e095b5..f838701 100644
--- a/src/main/java/com/shapesecurity/salvation2/Policy.java
+++ b/src/main/java/com/shapesecurity/salvation2/Policy.java
@@ -253,7 +253,7 @@ public class Policy {
 			}
 			case "report-uri": {
 				// https://w3c.github.io/webappsec-csp/#directive-report-uri
-				directiveErrorConsumer.add(Severity.Warning,"The report-uri directive has ben deprecated in favor of the new report-to directive", -1);
+				directiveErrorConsumer.add(Severity.Warning,"The report-uri directive has been deprecated in favor of the new report-to directive", -1);
 
 				ReportUriDirective thisDirective = new ReportUriDirective(values, directiveErrorConsumer);
 				if (this.reportUri == null) {


Test patch:
diff --git a/src/test/java/com/shapesecurity/salvation2/ParserTest.java b/src/test/java/com/shapesecurity/salvation2/ParserTest.java
index 5b3a07e..10c5995 100644
--- a/src/test/java/com/shapesecurity/salvation2/ParserTest.java
+++ b/src/test/java/com/shapesecurity/salvation2/ParserTest.java
@@ -206,7 +206,7 @@ public class ParserTest extends TestBase {
 
 		roundTrips(
 				"report-uri a a",
-				e(Policy.Severity.Warning, "The report-uri directive has ben deprecated in favor of the new report-to directive", 0, -1),
+				e(Policy.Severity.Warning, "The report-uri directive has been deprecated in favor of the new report-to directive", 0, -1),
 				e(Policy.Severity.Info, "Duplicate report-to URI; are you sure you intend to get multiple copies of each report?", 0, 1)
 		);
 
@@ -265,8 +265,8 @@ public class ParserTest extends TestBase {
 
 		roundTrips(
 				"report-uri http://example.com; report-uri http://example.com",
-				e(Policy.Severity.Warning, "The report-uri directive has ben deprecated in favor of the new report-to directive", 0, -1),
-				e(Policy.Severity.Warning, "The report-uri directive has ben deprecated in favor of the new report-to directive", 1, -1),
+				e(Policy.Severity.Warning, "The report-uri directive has been deprecated in favor of the new report-to directive", 0, -1),
+				e(Policy.Severity.Warning, "The report-uri directive has been deprecated in favor of the new report-to directive", 1, -1),
 				e(Policy.Severity.Warning, "Duplicate directive report-uri", 1, -1)
 		);
 
@@ -601,7 +601,7 @@ public class ParserTest extends TestBase {
 
 			roundTrips(
 					"report-uri",
-					e(Policy.Severity.Warning, "The report-uri directive has ben deprecated in favor of the new report-to directive", 0, -1),
+					e(Policy.Severity.Warning, "The report-uri directive has been deprecated in favor of the new report-to directive", 0, -1),
 					e(Policy.Severity.Error, "The report-uri value requires at least one value", 0, -1)
 			);