CenterForDigitalHumanities / TPEN28

Split front/back ends from each other
4 stars 2 forks source link

Canvas Servlet 404 Scenario #638

Open thehabes opened 2 years ago

thehabes commented 2 years ago

In CanvasServlet.java...

if (folioID > 0) {
//Respond with 200
}
else{
 //Respond with 404
}

This is somewhat off the mark. http://localhost:8080/TPEN/canvas/011100010101 returns a 200, but there is no folio with id 011100010101

The response code should be better, like

if (folioID > 0) {
   if(folio exists with this id){
      //respond with 200
   }
   else{
     //respond with 404
   }
}
else{
   // There is no folio with a negative id, or 0, or null id.  so 404
}
thehabes commented 2 years ago

This one is just the worst. If you only fixed this situation, it would be worth it.

https://tpentest.rerum.io/TPEN/canvas/