Skip to content

Commit

Permalink
adding double escape
Browse files Browse the repository at this point in the history
  • Loading branch information
scbedd committed Jul 18, 2023
1 parent fab2114 commit a9e2eea
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ public async Task ThisShouldWork()

// this is what your json body will look like coming over the wire. Notice the double escapes to prevent JSON parse break.
// it is an identical sanitizer registration to the one above
var overTheWire = "{ \"value\": \".sanitized.com\", \"regex\": \"([0-9a-fA-F]{8}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{4}\\-[0-9a-fA-F]{12}[^/?]+)\" }";
var overTheWire = "{ \"value\": \".sanitized.com\", \"regex\": \"([0-9a-fA-F]{8}\\\\-[0-9a-fA-F]{4}\\\\-[0-9a-fA-F]{4}\\\\-[0-9a-fA-F]{4}\\\\-[0-9a-fA-F]{12}[^/?]+)\" }";

// Target the type of sanitizer using this. (This is similar to selecting a constructor above)
var sanitizerName = "BodyRegexSanitizer";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public async Task ThisShouldWorkContainerURI()
#endregion

session.Session.Sanitize(registeredSanitizer);
var newBody = Encoding.UTF8.GetString(session.Session.Entries[2].Response.Body);
var newBody = Encoding.UTF8.GetString(session.Session.Entries[1].Response.Body);
Assert.Contains("REDACTED", newBody);
}
}
Expand Down

0 comments on commit a9e2eea

Please sign in to comment.