DMarby / picsum-photos

Lorem Ipsum... but for photos.
https://picsum.photos
MIT License
2.2k stars 152 forks source link

/seed/{seed}/info returns same image regardless of seed #104

Closed mootari closed 1 year ago

mootari commented 1 year ago

The route /seed/{seed}/info always returns the same info. A few examples:

In all cases the (formatted) response is:

{
    "id": "989",
    "author": "Paul Jarvis",
    "width": 4896,
    "height": 3264,
    "url": "https://unsplash.com/photos/eBDdgbM5dSo",
    "download_url": "https://picsum.photos/id/989/4896/3264"
}
mootari commented 1 year ago

My best guess is that the path variable {id} needs to be changed to {seed} in

https://github.com/DMarby/picsum-photos/blob/5d4f882b7c06a19b2ea415ce753f68b0e2d8c59b/internal/api/api.go#L69

as that is what is referenced in

https://github.com/DMarby/picsum-photos/blob/5d4f882b7c06a19b2ea415ce753f68b0e2d8c59b/internal/api/list.go#L50-L52

But the variable has remained unchanged since it was originally added, and surely that would have caused the test to fail?

DMarby commented 1 year ago

Hi @mootari,

Thank you for reporting this, a fix has been deployed, so this should work correctly now. It seems like it is was indeed broken from the start, and the test was not able to catch it since it doesn't encompass multiple seeds, I'll look into expanding it in the future.

mootari commented 1 year ago

Works beautifully - thank you for the fix and the quick response!