Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What does this change?
The download (+ bulk download) button in the client will now download images via the api download link. This allows for metrics to be gathered about which images have been downloaded and who downloaded which images.
Additionally a new endpoint has been added to the api which allows for optimised images to be downloaded in a similar way to the original images (this also redirects you to imgops).
As the download link now calls the API, the users auth cookie needs to be present, and so the
withCredentials
flag was added. This caused a slight problem with nginx as it had a wildcard for the origin, so this was fixed by adding a couple of headers you will see in the PR - I don't think this should have any adverse effects but not an expert on this!