mirror of
https://gitlab.com/wgp/dougal/software.git
synced 2025-12-06 12:57:08 +00:00
Commands used: find . -type f -name '*.js'| while read FILE; do if echo $FILE |grep -qv node_modules; then sed -ri 's/^\s+$//' "$FILE"; fi; done find . -type f -name '*.vue'| while read FILE; do if echo $FILE |grep -qv node_modules; then sed -ri 's/^\s+$//' "$FILE"; fi; done find . -type f -name '*.py'| while read FILE; do if echo $FILE |grep -qv node_modules; then sed -ri 's/^\s+$//' "$FILE"; fi; done
22 lines
456 B
JavaScript
22 lines
456 B
JavaScript
const fetch = require('node-fetch');
|
|
|
|
module.exports = async function (req, res, next) {
|
|
|
|
try {
|
|
if (req.query.remote) {
|
|
// We're being asked to fetch a remote feed
|
|
// NOTE: No, we don't limit what feeds the user can fetch
|
|
|
|
const r = await fetch(req.query.remote);
|
|
if (r && r.ok) {
|
|
res.set("Content-Type", "application/xml");
|
|
res.send(await r.text());
|
|
return;
|
|
}
|
|
}
|
|
res.status(400).send();
|
|
} catch (err) {
|
|
next(err);
|
|
}
|
|
}
|