[refactor] proxy url by header for node server

This commit is contained in:
kwaroran
2023-07-07 06:30:59 +09:00
parent e338940708
commit ed1adaa4ae

View File

@@ -41,7 +41,8 @@ app.get('/', async (req, res, next) => {
})
const proxyFunc = async (req, res, next) => {
const urlParam = req.query.url;
const urlParam = req.headers['risu-url'] ? JSON.parse(decodeURIComponent(req.headers['risu-url'])) : req.query.url;
if (!urlParam) {
res.status(400).send({