From baba524caf8d76d18cd61954cfe29473eea26efe Mon Sep 17 00:00:00 2001 From: Jakub Zych Date: Sat, 14 Nov 2026 17:32:14 +0100 Subject: [PATCH] fix(35): WR-01 strip whitespace before the list, meta, CSS and comment scheme checks Single-URL attributes removed ASCII whitespace and control characters before looking for a scheme, the list-valued, meta content, style and comment checks did not, so values="java script:..." and a tab-split meta refresh passed. The stripping is factored out as stripURLSpace and used by every scheme check. --- docs/services/mail.md | 2 +- modules/postcard/README.md | 2 +- modules/postcard/safety.go | 39 +++++++++++++++++++++++---------- modules/postcard/safety_test.go | 7 ++++++ 4 files changed, 36 insertions(+), 14 deletions(-) diff --git a/docs/services/mail.md b/docs/services/mail.md index b560c5ae..bdf3ef8e 100644 --- a/docs/services/mail.md +++ b/docs/services/mail.md @@ -155,7 +155,7 @@ fmt.Println(err != nil, len(driver.Messages())) postcard does not pick a locale: the caller passes the full name. A per-language version of a template is a file named after the template, a dash and the locale (`welcome-en.htm`, sent as `acme.blog::mail.welcome-en`). A name with its own file always renders that file. A name the catalog does not hold, of the form `