Skip to content

Commit

Permalink
Used root URL to compose download URL with namespace (#768)
Browse files Browse the repository at this point in the history
  • Loading branch information
milanmajchrak authored Dec 10, 2024
1 parent 359954a commit 129629c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { Bitstream } from '../../core/shared/bitstream.model';
import { take } from 'rxjs/operators';
import { getBitstreamDownloadRoute } from '../../app-routing-paths';
import { HardRedirectService } from '../../core/services/hard-redirect.service';
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';

/**
* This component shows error that the download token is expired and redirect the user to the Item View page
Expand All @@ -21,13 +22,14 @@ export class ClarinBitstreamTokenExpiredComponent implements OnInit {

constructor(
private hardRedirectService: HardRedirectService,
private halService: HALEndpointService
) { }

ngOnInit(): void {
setTimeout(() => {
this.bitstream$.pipe(take(1))
.subscribe(bitstream => {
const bitstreamDownloadPath = getBitstreamDownloadRoute(bitstream);
const bitstreamDownloadPath = this.halService.getRootHref() + getBitstreamDownloadRoute(bitstream);
this.hardRedirectService.redirect(bitstreamDownloadPath);
});
},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,7 @@ export class ClarinLicenseAgreementPageComponent implements OnInit {
});
let bitstreamDownloadPath = getBitstreamDownloadRoute(bitstream);
if (isNotEmpty(downloadToken)) {
bitstreamDownloadPath = bitstreamDownloadPath + '?dtoken=' + downloadToken;
bitstreamDownloadPath = this.halService.getRootHref() + bitstreamDownloadPath + '?dtoken=' + downloadToken;
}
this.hardRedirectService.redirect(bitstreamDownloadPath);
}
Expand Down

0 comments on commit 129629c

Please sign in to comment.