News for hackers. Stuff that matters.
Re:Show HN: Brutal.js – a small framework for building bruta... by spankalee on Sunday July 08, 2018 @08:53PM (#17487213)
It doesn't throw, the unsafe version is just escaped by the browser:

Let's consider a container where a function like `header` would be used:

    const page = (title, body) => html`
      ${header(title)}
      <p>${body}</p>
    `;
If you use the safe version, you might get:

    <h1>Foo</h1>
    <p>Bar</p>
but if you use the unsafe version, you'd get:

    &lt;h1&gt;Foo&lt;/h1&gt;
    <p>Bar</p>
See a demo here: https://stackblitz.com/edit/lit-html-escaping?file=index.js
Re:Show HN: Brutal.js – a small framework for building bruta... by franciscop on Monday July 09, 2018 @07:02PM (#17494118)
Ah cool, that works as well from a security point of view. I slightly prefer throwing, but that is highly opinionated.