mirror of
https://github.com/github/codeql.git
synced 2026-04-30 19:26:02 +02:00
JS: format qhelp examples
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
app.get('/some/path', function(req, res) {
|
||||
app.get("/some/path", function(req, res) {
|
||||
let url = req.param("url");
|
||||
// BAD: the host of `url` may be controlled by an attacker
|
||||
if (url.match(/https?:\/\/www\.example\.com\//)) {
|
||||
if (url.match(/https?:\/\/www\.example\.com\//)) {
|
||||
res.redirect(url);
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
app.get('/some/path', function(req, res) {
|
||||
app.get("/some/path", function(req, res) {
|
||||
let url = req.param("url");
|
||||
// GOOD: the host of `url` can not be controlled by an attacker
|
||||
if (url.match(/^https?:\/\/www\.example\.com\//)) {
|
||||
if (url.match(/^https?:\/\/www\.example\.com\//)) {
|
||||
res.redirect(url);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user