Closed jberger closed 7 years ago
This is the Mojo bug in question https://github.com/kraih/mojo/issues/999 and this is a PR which hopefully addresses it https://github.com/kraih/mojo/pull/1000. As I say, the bug only affects your tests, browsers should handle 303s correctly and it won't involve accidentally deleting more than you intended to!
Sorry it is late and I've started to ramble. I've not been very clear. (If it weren't so late I'd probably make you a PR). Even before the Mojo bug is fixed, you should add $self->res->code(303);
here https://github.com/vikin91/BibSpace/blob/master/lib/BibSpace/Controller/Backup.pm#L150 . That will cause your redirects to end up as GET
requests to /backups
. Once the bug is fixed you will be able to write tests for it. (sorry for the rambling, time for bed :-P)
Thanks for the information, I will give it a look. I am happy that I could contribute towards discovering this bug.
Hi. I was just reading through SO and saw your unanswered question. I posted a response http://stackoverflow.com/a/39553660/468327 . It is kinda embarassing because I had to admit that Mojolicious has a bug (at least I assume it is one). That said, it has an important thing in it for your project. I think by using the wrong type of redirect you are accidentally redirecting from
DELETE /backups/:id
toDELETE /backups
. This seems like it might be serious so I wanted to open this issue to be sure you saw it.Until the Mojo bug is fixed you can't easily test the behavior of 303 redirects, but you should be able to see the different in a browser, which is the important thing I suppose.