Skip to content

Commit 3132e7b

Browse files
dariatiurinatomerqodo
authored andcommitted
Fix test EmbeddingServerAppInsideIframe_WithCompressionEnabled_Fails (dotnet#64326)
(cherry picked from commit c4f8522)
1 parent 35526fe commit 3132e7b

1 file changed

Lines changed: 8 additions & 2 deletions

File tree

src/Components/test/E2ETest/ServerExecutionTests/WebSocketCompressionTests.cs

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -104,11 +104,17 @@ public void EmbeddingServerAppInsideIframe_WithCompressionEnabled_Fails()
104104

105105
Assert.True(logs.Count > 0);
106106

107-
Assert.Matches(ParseErrorMessage(), logs[0].Message);
107+
Assert.True(
108+
ParseErrorMessageRegexOld.IsMatch(logs[0].Message) ||
109+
ParseErrorMessageRegexNew.IsMatch(logs[0].Message),
110+
$"Expected log message to match one of the CSP error patterns: {ParseErrorMessageRegexOld} or {ParseErrorMessageRegexNew}. Actual: {logs[0].Message}");
108111
}
109112

110113
[GeneratedRegex(@"security - Refused to frame 'http://\d+\.\d+\.\d+\.\d+:\d+/' because an ancestor violates the following Content Security Policy directive: ""frame-ancestors 'none'"".")]
111-
private static partial Regex ParseErrorMessage();
114+
private static partial Regex ParseErrorMessageRegexOld { get; }
115+
116+
[GeneratedRegex(@"security - Framing 'http://\d+\.\d+\.\d+\.\d+:\d+/' violates the following Content Security Policy directive: ""frame-ancestors 'none'"".")]
117+
private static partial Regex ParseErrorMessageRegexNew { get; }
112118
}
113119

114120
public partial class DefaultConfigurationWebSocketCompressionTests : AllowedWebSocketCompressionTests

0 commit comments

Comments
 (0)