Skip to content

Commit 2dfaa29

Browse files
test: update renderer tests for request and response headers
1 parent 867521a commit 2dfaa29

1 file changed

Lines changed: 10 additions & 2 deletions

File tree

DebugProbe.AspNetCore.Tests/Rendering/HtmlRendererTests.cs

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ public void Html_encoding_escapes_untrusted_values()
6464
var entry = CreateEntry();
6565
entry.Method = "<script>alert(1)</script>";
6666
entry.Path = "/orders/<bad>";
67-
entry.Headers["X-Unsafe"] = "<img src=x onerror=alert(1)>";
67+
entry.RequestHeaders["X-Unsafe"] = "<img src=x onerror=alert(1)>";
6868

6969
var html = HtmlRenderer.RenderDetailsPage(
7070
entry,
@@ -94,7 +94,15 @@ private static DebugEntry CreateEntry()
9494
DurationMs = 12,
9595
Timestamp = new DateTimeOffset(2026, 1, 2, 3, 4, 5, TimeSpan.Zero),
9696
RequestTimeUtc = new DateTimeOffset(2026, 1, 2, 3, 4, 5, TimeSpan.Zero),
97-
Headers = new Dictionary<string, string> { ["X-Test"] = "yes" }
97+
RequestHeaders = new Dictionary<string, string>
98+
{
99+
["X-Test"] = "yes"
100+
},
101+
102+
ResponseHeaders = new Dictionary<string, string>
103+
{
104+
["Content-Type"] = "application/json"
105+
}
98106
};
99107
}
100108

0 commit comments

Comments
 (0)