Skip to content

Commit

Permalink
Try to fix inconsistency in snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewlock committed Dec 4, 2023
1 parent d9d67c4 commit 7d5847a
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,13 @@ public async Task TestApiSecurityScan(string url, string body, HttpStatusCode ex
var dateTime = DateTime.UtcNow;
var result = await SubmitRequest(url, body, "application/json");
var spans = agent.WaitForSpans(2, minDateTime: dateTime);
#if !NET8_O_OR_GREATER
// Simple scrubber for the response content type in .NET 8
// .NET 8 doesn't add the content-length header, whereas previous versions do
settings.AddSimpleScrubber(
"""_dd.appsec.s.res.headers: [{"content-length":[[[8]],{"len":1}]}],""",
"""_dd.appsec.s.res.headers: [{}],""");
#endif
await VerifySpans(spans, settings);
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
span.kind: server,
_dd.appsec.s.req.body: [{"Property":[8],"Property2":[8],"Property3":[4],"Property4":[4]}],
_dd.appsec.s.req.headers: [{"connection":[[[8]],{"len":1}],"content-length":[[[8]],{"len":1}],"content-type":[[[8]],{"len":1}],"host":[[[8,{"category":"pii","type":"passport_number"}]],{"len":1}],"user-agent":[[[8]],{"len":1}],"x-forwarded-for":[[[8]],{"len":1}]}],
_dd.appsec.s.res.headers: [{"content-length":[[[8]],{"len":1}]}],
_dd.appsec.s.res.headers: [{}],
_dd.git.commit.sha: aaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbb,
_dd.git.repository_url: https://github.com/DataDog/dd-trace-dotnet,
_dd.runtime_family: dotnet
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@
_dd.appsec.s.req.body: [{"Property":[8],"Property2":[8],"Property3":[4],"Property4":[4]}],
_dd.appsec.s.req.headers: [{"content-length":[[[8]],{"len":1}],"content-type":[[[8]],{"len":1}],"host":[[[8,{"category":"pii","type":"passport_number"}]],{"len":1}],"user-agent":[[[8]],{"len":1}],"x-forwarded-for":[[[8]],{"len":1}]}],
_dd.appsec.s.req.params: [{"action":[8],"controller":[8]}],
_dd.appsec.s.res.headers: [{"content-length":[[[8]],{"len":1}]}],
_dd.appsec.s.res.headers: [{}],
_dd.git.commit.sha: aaaaaaaaaaaaaaaaaaaaabbbbbbbbbbbbbbbbbbbbbbb,
_dd.git.repository_url: https://github.com/DataDog/dd-trace-dotnet,
_dd.runtime_family: dotnet
Expand Down

0 comments on commit 7d5847a

Please sign in to comment.