Skip to content

Commit 129629c

Browse files
Used root URL to compose download URL with namespace (#768)
1 parent 359954a commit 129629c

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

src/app/bitstream-page/clarin-bitstream-token-expired/clarin-bitstream-token-expired.component.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Bitstream } from '../../core/shared/bitstream.model';
44
import { take } from 'rxjs/operators';
55
import { getBitstreamDownloadRoute } from '../../app-routing-paths';
66
import { HardRedirectService } from '../../core/services/hard-redirect.service';
7+
import { HALEndpointService } from '../../core/shared/hal-endpoint.service';
78

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

2223
constructor(
2324
private hardRedirectService: HardRedirectService,
25+
private halService: HALEndpointService
2426
) { }
2527

2628
ngOnInit(): void {
2729
setTimeout(() => {
2830
this.bitstream$.pipe(take(1))
2931
.subscribe(bitstream => {
30-
const bitstreamDownloadPath = getBitstreamDownloadRoute(bitstream);
32+
const bitstreamDownloadPath = this.halService.getRootHref() + getBitstreamDownloadRoute(bitstream);
3133
this.hardRedirectService.redirect(bitstreamDownloadPath);
3234
});
3335
},

src/app/bitstream-page/clarin-license-agreement-page/clarin-license-agreement-page.component.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ export class ClarinLicenseAgreementPageComponent implements OnInit {
257257
});
258258
let bitstreamDownloadPath = getBitstreamDownloadRoute(bitstream);
259259
if (isNotEmpty(downloadToken)) {
260-
bitstreamDownloadPath = bitstreamDownloadPath + '?dtoken=' + downloadToken;
260+
bitstreamDownloadPath = this.halService.getRootHref() + bitstreamDownloadPath + '?dtoken=' + downloadToken;
261261
}
262262
this.hardRedirectService.redirect(bitstreamDownloadPath);
263263
}

0 commit comments

Comments
 (0)