diff options
| author | Xe <me@christine.website> | 2022-11-22 15:30:43 -0500 |
|---|---|---|
| committer | Xe <me@christine.website> | 2022-11-22 15:30:43 -0500 |
| commit | ce1e2f44562a1c19b9052123fc9f346ae60fccf3 (patch) | |
| tree | 700135cfdea1bcbe8aa43e814045586683027a1a /web | |
| parent | c87eb51e0afe78a958eecaffb83318f91c6f78dd (diff) | |
| download | x-ce1e2f44562a1c19b9052123fc9f346ae60fccf3.tar.xz x-ce1e2f44562a1c19b9052123fc9f346ae60fccf3.zip | |
web/mastosan: add benchmark
Signed-off-by: Xe <me@christine.website>
Diffstat (limited to 'web')
| -rw-r--r-- | web/mastosan/mastosan_test.go | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/web/mastosan/mastosan_test.go b/web/mastosan/mastosan_test.go index efdec88..5f1f9fa 100644 --- a/web/mastosan/mastosan_test.go +++ b/web/mastosan/mastosan_test.go @@ -2,6 +2,8 @@ package mastosan import ( "context" + "fmt" + "io" "testing" "time" ) @@ -30,3 +32,15 @@ func TestHTML2Slackdown(t *testing.T) { }) } } + +const msg = `<p>Tailscale has recently been notified of security vulnerabilities in the Tailscale Windows client which allow a malicious website visited by a device running Tailscale to change the Tailscale daemon configuration and access information in the Tailscale local and peer APIs.</p><p>To patch these vulnerabilities, upgrade Tailscale on your Windows machines to Tailscale v1.32.3 or later, or v1.33.257 or later (unstable).</p><p><a href="https://tailscale.com/blog/windows-security-vulnerabilities/" target="_blank" rel="nofollow noopener noreferrer"><span class="invisible">https://</span><span class="ellipsis">tailscale.com/blog/windows-sec</span><span class="invisible">urity-vulnerabilities/</span></a></p>` + +func BenchmarkHTML2Slackdown(b *testing.B) { + for i := 0; i < b.N; i++ { + result, err := HTML2Slackdown(context.Background(), msg) + if err != nil { + b.Fatal(err) + } + fmt.Fprintln(io.Discard, result) + } +} |
