Skip to content

Commit 20c13c2

Browse files
committed
feat: ensure that the HTTPS connection is closed
The default e.g. with GitHub Pages seems to be to keep the connection alive, which does not make sense here. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent bcbff71 commit 20c13c2

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

index.js

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,18 @@ const run = async () => {
5050
const octokit = getOctokit(core.getInput('github-token'))
5151

5252
// Instantiate feed parser
53-
const feed = await (new RSSParser({ xml2js: { trim: true } })).parseURL(core.getInput('feed'))
53+
const rssParserOptions = {
54+
headers: {
55+
'User-Agent': 'rss-parser',
56+
Accept: 'application/rss+xml',
57+
// do not keep the connection alive
58+
Connection: 'close'
59+
},
60+
xml2js: {
61+
trim: true
62+
}
63+
}
64+
const feed = await (new RSSParser(rssParserOptions)).parseURL(core.getInput('feed'))
5465
core.info(feed && feed.title)
5566
if (!feed.items || feed.items.length === 0) return
5667

0 commit comments

Comments
 (0)