Permalink
Browse files

Merge pull request #64 from electron/add-a-word-of-caution-about-redi…

…rects

docs: add a word of caution about redirects
  • Loading branch information...
zeke committed Oct 4, 2018
2 parents e1a1419 + 7ced3ab commit f475d9c42791d7f48324c4a3fa4ad2fcabd16232
Showing with 2 additions and 0 deletions.
  1. +2 −0 index.js
View
@@ -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)

0 comments on commit f475d9c

Please sign in to comment.