Skip to content

Commit 6f2bba6

Browse files
Matus Kasakclaude
andcommitted
Shorten the legacy-bitstream-redirect comment
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 30f2333 commit 6f2bba6

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

src/app/bitstream-page/legacy-bitstream-url-redirect.guard.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,8 @@ export const legacyBitstreamURLRedirectGuard: CanActivateFn = (
5151
getFirstCompletedRemoteData(),
5252
map((rd: RemoteData<Bitstream>) => {
5353
if (rd.hasSucceeded && !rd.hasNoContent) {
54-
// Redirect to a namespace-prefixed, root-relative path so the target stays inside the app
55-
// when it is mounted under a sub-path (e.g. '/repository'). Building an absolute URL from
56-
// HardRedirectService.getBaseUrl() (environment.ui.baseUrl) dropped that namespace - a
57-
// leading-slash path resolves against the origin only - and could even point at the
58-
// internal SSR host, landing the user on a broken URL.
54+
// Prefix the UI namespace and redirect to a root-relative path so the target keeps the
55+
// '/repository' base path when the app is mounted under a sub-path.
5956
const nameSpace = environment.ui.nameSpace?.replace(/\/$/, '') || '';
6057
serverHardRedirectService.redirect(nameSpace + getBitstreamDownloadRoute(rd.payload), 301);
6158
return false;

0 commit comments

Comments
 (0)