From 90c79a2868e93e7a5cd6183ecba3910850db6a16 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gon=C3=A7alo=20Val=C3=A9rio?= Date: Sat, 1 May 2021 15:43:13 +0100 Subject: [PATCH] add very simple csp and rss link to the generated html --- index.js | 8 +++++++- templates/list_posts.handlebars | 2 +- templates/list_posts.precompiled.js | 2 +- 3 files changed, 9 insertions(+), 3 deletions(-) diff --git a/index.js b/index.js index 1b1676d..058439b 100644 --- a/index.js +++ b/index.js @@ -30,6 +30,8 @@ async function handleRequest(request) { headers: { 'content-type': 'text/html;charset=UTF-8', 'Cache-Control': 'max-age=3600', + 'Content-Security-Policy': + "script-src 'none'; style-src cdn.jsdelivr.net;", }, }) } else if (path === '/rss') { @@ -158,5 +160,9 @@ function createFeed(items) { */ function createHTML(items) { let template = Handlebars.templates['list_posts'] - return template({ items: items, page_title: TITLE }) + return template({ + items: items, + page_title: TITLE, + page_description: DESCRIPTION, + }) } diff --git a/templates/list_posts.handlebars b/templates/list_posts.handlebars index 9c8f142..4c7b3d0 100644 --- a/templates/list_posts.handlebars +++ b/templates/list_posts.handlebars @@ -6,7 +6,7 @@ {{page_title}} - + diff --git a/templates/list_posts.precompiled.js b/templates/list_posts.precompiled.js index f0d53bb..3b1a6e9 100644 --- a/templates/list_posts.precompiled.js +++ b/templates/list_posts.precompiled.js @@ -188,7 +188,7 @@ templates['list_posts'] = template({ }) : helper), ) + - '\n\n \n\n\n\n