Repository navigation
CLARIN-DSpace v9: redirect anonymous bitstream download on the server too - #1641
Open
milanmajchrak wants to merge 1 commit into
Open
milanmajchrak wants to merge 1 commit into
milanmajchrak wants to merge 1 commit into
Conversation
… too Port of dtq-dev PR 1615 (commit dd5a17b), written for the 9.x component. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
References
Port of dtq-dev PR 1615 (commit dd5a17b), still open there. dspace-customers issue 1048, point 1 (citation_pdf_url returns HTML instead of the file).
Description
Anonymous requests to
/bitstreams/<uuid>/downloadget a 302 to the file from the server too. Until now SSR rendered the download page as 200 HTML: there is nowindowin Node,window.location.replacethrows and the render finishes as a normal page.Instructions for Reviewers
ClarinBitstreamDownloadPageComponent, anonymous branch only:window.location.replace(bitstreamURL)becomesthis.hardRedirectService.redirect(bitstreamURL). In the browser both end inlocation.replace. Logged-in users keep the client-side redirect, a server 302 right after login left the browser on the login page.redirectToContent()stays for logged-in users, the anonymous branch callshardRedirectService.redirect(); the two anonymous specs expect the service callcurl -s -o /dev/null -D - https://<host>/bitstreams/<uuid>/download(GET, SSR renders only GET) must answer 302 withLocation: .../server/api/core/bitstreams/<uuid>/contentclarin-bitstream-download-page.component.spec.tspasses locally (20 tests), eslint cleanChecklist
🤖 Generated with Claude Code