Skip to content

Commit

Permalink
fix: ensure url is a string while using /proxy
Browse files Browse the repository at this point in the history
  • Loading branch information
kernoeb committed Dec 11, 2024
1 parent d6b5b11 commit dac8fcc
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions server/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ let app = module.exports = express()

// Business routers
app.get('/proxy', (req, res) => {
if (!req.query.url || typeof req.query.url !== 'string') {
return res.status(400).send('url query parameter is required')
}

axios.get(req.query.url, {
responseType: 'stream'
}).then((response) => {
Expand Down

0 comments on commit dac8fcc

Please sign in to comment.