Skip to content

Commit

Permalink
No commit message
Browse files Browse the repository at this point in the history
  • Loading branch information
leafac committed May 14, 2024
1 parent 987d68d commit 825aa82
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 12 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
"backup": "rsync -av --delete --progress [email protected]:kill-the-newsletter/data/ /Volumes/leafac--external-storage/Backups/kill-the-newsletter/"
},
"dependencies": {
"@radically-straightforward/production": "^1.0.12",
"@radically-straightforward/production": "^1.0.13",
"crypto-random-string": "^5.0.0",
"mailparser": "^3.7.1",
"smtp-server": "^3.13.4"
Expand Down
9 changes: 8 additions & 1 deletion source/index.mts
Original file line number Diff line number Diff line change
Expand Up @@ -678,7 +678,14 @@ switch (commandLineArguments.values.type) {
`,
);
if (entry === undefined) return;
response.setHeader("X-Robots-Tag", "none").end(entry.content);
response
.setHeader(
"Content-Security-Policy",
"default-src 'self'; img-src *; style-src 'self' 'unsafe-inline'; frame-src 'none'; object-src 'none'; form-action 'self'; frame-ancestors 'none'",
)
.setHeader("Cross-Origin-Embedder-Policy", "unsafe-none")
.setHeader("X-Robots-Tag", "none")
.end(entry.content);
},
});
application.push({
Expand Down
8 changes: 6 additions & 2 deletions source/index.test.mts
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
import nodemailer from "nodemailer";

process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

await nodemailer
.createTransport({
host: "localhost",
port: 25,
})
.sendMail({
from: `"Example of Sender" <[email protected]>`,
to: `"Example of Recipient" <qni66g9alnwozwsrbrgw@localhost>`,
to: `"Example of Recipient" <r5bsqg3w6gqrsv7m59f1@localhost>`,
subject: "Example of a Newsletter Entry",
html: "<p>Hello <strong>World</strong></p>".repeat(2 ** 0 /*13*/),
html: "<p>Hello <strong>World</strong> <img src='https://interactive-examples.mdn.mozilla.net/media/cc0-images/grapefruit-slice-332-332.jpg'/></p>".repeat(
2 ** 0 /*13*/,
),
});

0 comments on commit 825aa82

Please sign in to comment.