Skip to content

Commit e08d525

Browse files
Encode HTML in fortunes
1 parent f085c80 commit e08d525

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

frameworks/CSharp/genhttp/Benchmarks/Resources/Template.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
{for cookie in cookies:
1414
<tr>
1515
<td>{ cookie.id }</td>
16-
<td>{ cookie.message | escape }</td>
16+
<td>{ cookie.message }</td>
1717
</tr>
1818
}
1919
</table>

frameworks/CSharp/genhttp/Benchmarks/Tests/FortuneHandler.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using Benchmarks.Model;
1+
using System.Web;
2+
using Benchmarks.Model;
23
using Cottle;
34
using GenHTTP.Api.Content;
45
using GenHTTP.Api.Protocol;
@@ -58,7 +59,7 @@ private static async ValueTask<List<Value>> GetFortunes()
5859
result.Add(Value.FromDictionary(new Dictionary<Value, Value>()
5960
{
6061
["id"] = fortune.Id,
61-
["message"] = fortune.Message
62+
["message"] = HttpUtility.HtmlEncode(fortune.Message)
6263
}));
6364
}
6465

0 commit comments

Comments
 (0)