We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b9e2c49 commit 4a4d1dbCopy full SHA for 4a4d1db
1 file changed
app/routes/research.js
@@ -13,15 +13,17 @@ function ResearchHandler(db) {
13
14
if (req.query.symbol) {
15
const url = req.query.url + req.query.symbol;
16
- return needle.get(url, (error, newResponse) => {
+ return needle.get(url, (error, newResponse, body) => {
17
if (!error && newResponse.statusCode === 200) {
18
res.writeHead(200, {
19
"Content-Type": "text/html"
20
});
21
}
22
res.write("<h1>The following is the stock information you requested.</h1>\n\n");
23
res.write("\n\n");
24
- res.write(newResponse.body);
+ if (body) {
25
+ res.write(body);
26
+ }
27
return res.end();
28
29
0 commit comments