Calling int() on a string raises a ValueError, return 404 instead.
int()
I'm :thumbsup: to the change but a little surprised on how we trigger this, since the only case I can think of is if idx is None
idx
None
This was triggered from some dev data in fmn.sse where the img src attribute was not a full url and was trying to make a GET to //fake_image.png.
fmn.sse
This is just a preventative measure so if we somehow get a messed up url from the streaming server, it doesn't crash the app.
Another way we could re-enforce our app is by specifying that idx must be an int in the routing, for example at https://pagure.io/fork/atelic/fedora-hubs/blob/fix/int-exception/f/hubs/app.py#_366 put <int:idx> in the routing itself :)
<int:idx>
@pingou might as well change all the routes to use <int:idx>
@skrzepto that was my proposal indeed :)
rebased
:thumbsup: for me
Do we want to go belt and suspenders and add the original fix as well?
Why not?
Still looking good to me :)
Pull-Request has been merged by atelic
Calling
int()on a string raises a ValueError, return 404 instead.