Created
October 24, 2014 03:18
-
-
Save ahamid/4064dc457a80ced1ab29 to your computer and use it in GitHub Desktop.
Express recursive route matching can overflow stack
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var express = require("express"); | |
var app = express(); | |
var TOO_MANY = 8000; | |
function handler(req, res) { | |
res.send("handler"); | |
} | |
// test higher routes, eventually you will get | |
// RangeError: Maximum call stack size exceeded | |
for (var i = 0; i < TOO_MANY; i++) { | |
app.get('/' + i, handler); | |
} | |
app.listen(8181); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment