Skip to content

Commit 003e99c

Browse files
committed
add location header to redirect according to body input
1 parent 4b59d8f commit 003e99c

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

router.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,10 @@ function home(req, res) {
1111
render.view("search", {}, res);
1212
render.view("footer", {}, res);
1313
res.end('End of the response\n');
14-
1514
} else {
1615
req.on("data", function (postBody) {
1716
var query = querystring.parse(postBody.toString());
18-
res.write(query.username);
17+
res.writeHead(303, { "location": "/" + query.username });
1918
res.end();
2019
})
2120
}

0 commit comments

Comments
 (0)