Skip to content

Commit 4b59fe3

Browse files
committed
Use http if no protocol provided on all requests
1 parent e04526c commit 4b59fe3

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

src/_data/depctrl.js

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var procesesed = [];
1111
const limitedWebRequest = async (url, type) => {
1212
// Limit to web url
1313
if (!url.toLowerCase().startsWith("http://") && !url.toLowerCase().startsWith("https://")) {
14-
return Promise.reject(new Error("Only http and https urls are allowed"));
14+
url = "http://" + url;
1515
}
1616

1717
return limit((url, type) => EleventyFetch(url, {
@@ -160,9 +160,6 @@ const resolveReverseDependencies = async (feeds) => {
160160

161161
// fetch single feed
162162
const fetchFeed = (url) => {
163-
if (!url.startsWith("https://") && !url.startsWith("http://")) {
164-
url = "http://" + url;
165-
}
166163
return limitedWebRequest(url, "text")
167164
.then((feedResponse) => {
168165
// remove trailing commas. Not ideal as there can be false positives

0 commit comments

Comments
 (0)