Skip to content

Commit f774c29

Browse files
gabyCopilot
andauthored
Potential fix for pull request finding
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
1 parent cc5d809 commit f774c29

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

ctx_test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2175,7 +2175,7 @@ func Test_Ctx_AutoFormat_XSS_Prevention(t *testing.T) {
21752175
Value string
21762176
}{Value: "<script>alert('XSS')</script>"})
21772177
require.NoError(t, err)
2178-
// When formatted as string via fmt.Sprintf, the struct becomes something like {Value:<script>...}
2178+
// When formatted as a string via fmt.Sprintf with %v, the struct becomes something like {<script>...}
21792179
require.NotContains(t, string(c.Response().Body()), "<script>", "Script tags in struct should be escaped")
21802180
require.Contains(t, string(c.Response().Body()), "&lt;script&gt;", "Escaped script tags should be present")
21812181
}

0 commit comments

Comments
 (0)