Obey HTTP spec, use HTTP 404 for not-found responses

v1.18.x
Damian Bushong 12 years ago
parent 9c5e9083fe
commit 860a6351dd

@ -284,7 +284,7 @@ var express = require('express'),
}); });
break; break;
default : default :
res.json({}); res.json(404, { error: 'unrecognized API endpoint' });
break; break;
} }
} }
@ -300,7 +300,7 @@ var express = require('express'),
if(data) if(data)
res.send(data); res.send(data);
else else
res.send("Category doesn't exist!"); res.send(404, "Category doesn't exist!");
}); });
}); });
@ -309,7 +309,7 @@ var express = require('express'),
if(data) if(data)
res.send(data); res.send(data);
else else
res.send("Topic doesn't exist!"); res.send(404, "Topic doesn't exist!");
}); });
}); });
@ -318,7 +318,7 @@ var express = require('express'),
if(data) if(data)
res.send(data); res.send(data);
else else
res.send("Post doesn't exist!"); res.send(404, "Post doesn't exist!");
}); });
}); });

Loading…
Cancel
Save