Skip to content

Commit

Permalink
Merge pull request #64 from electron/add-a-word-of-caution-about-redi…
Browse files Browse the repository at this point in the history
…rects

docs: add a word of caution about redirects
  • Loading branch information
zeke committed Oct 4, 2018
2 parents e1a1419 + 7ced3ab commit f475d9c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ const json = (res, obj) => {
res.end(JSON.stringify(obj))
}

// DO NOT PASS USER-SUPPLIED CONTENT TO THIS FUNCTION
// AS IT WILL REDIRECT A USER ANYWHERE
const redirect = (res, url) => {
res.statusCode = 302
res.setHeader('Location', url)
Expand Down

0 comments on commit f475d9c

Please sign in to comment.