Skip to content

Commit 33f4617

Browse files
committed
Limit to fetching http(s) urls
1 parent c1d0306 commit 33f4617

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/_data/depctrl.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,11 @@ const seedFeed = "https://raw.githubusercontent.com/TypesettingTools/DependencyC
99
var procesesed = [];
1010

1111
const limitedWebRequest = async (url, type) => {
12+
// Limit to web url
13+
if (!url.toLowerCase().startsWith("http://") && !url.toLowerCase().startsWith("https://")) {
14+
return Promise.reject(new Error("Only http and https urls are allowed"));
15+
}
16+
1217
return limit((url, type) => EleventyFetch(url, {
1318
duration: "1d",
1419
type: type

0 commit comments

Comments
 (0)