aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--web/mastosan/mastosan_test.go14
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)
+ }
+}