unsplash / unsplash-photopicker-android

📱An Android photo picker to search and download photos from Unsplash.
MIT License
340 stars 65 forks source link

Download URL breaks with query string authentication #13

Closed aaronklaassen closed 3 years ago

aaronklaassen commented 3 years ago

Since this change to the API: https://changelog.unsplash.com/update/2021/03/09/download-ixid.html the download-tracking URL breaks due to the existing query string params: https://github.com/unsplash/unsplash-photopicker-android/blob/1d5a15723bb6d56cddcb69d194a8069964170f1e/photopicker/src/main/java/com/unsplash/pickerandroid/photopicker/domain/Repository.kt#L41 so the URL ends up looking something like photos/abc/download?ixid=def?client_id=ghi

This results in the request to the API failing with a 403.

This should either be changed to &client_id= (probably just as fragile) or better yet actually parse the URL to build the entire query string correctly.