Skip to content

CLARIN-DSpace v9: redirect anonymous bitstream download on the server too - #1641

Open
milanmajchrak wants to merge 1 commit into
dtq-dev-9-basefrom
9-base/fe-ssr-download-redirect
Open

milanmajchrak wants to merge 1 commit into
dtq-dev-9-basefrom
9-base/fe-ssr-download-redirect

Conversation

@milanmajchrak

@milanmajchrak milanmajchrak commented Oct 20, 2026 •

Copy link
Copy Markdown
Collaborator

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>/download get a 302 to the file from the server too. Until now SSR rendered the download page as 200 HTML: there is no window in Node, window.location.replace throws and the render finishes as a normal page.

Instructions for Reviewers

  • ClarinBitstreamDownloadPageComponent, anonymous branch only: window.location.replace(bitstreamURL) becomes this.hardRedirectService.redirect(bitstreamURL). In the browser both end in location.replace. Logged-in users keep the client-side redirect, a server 302 right after login left the browser on the login page.
  • written for the 9.x component: redirectToContent() stays for logged-in users, the anonymous branch calls hardRedirectService.redirect(); the two anonymous specs expect the service call
  • after deploy: curl -s -o /dev/null -D - https://<host>/bitstreams/<uuid>/download (GET, SSR renders only GET) must answer 302 with Location: .../server/api/core/bitstreams/<uuid>/content
  • clarin-bitstream-download-page.component.spec.ts passes locally (20 tests), eslint clean

Checklist

  • My PR is created against the branch it ports to
  • My PR is small in size
  • My PR follows the code conventions and passes ESLint
  • My PR passes all specs and includes new or updated specs
  • My PR includes details on how to test it
  • No new dependencies, no new configuration

🤖 Generated with Claude Code

… 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant