Skip to content

Commit 8eec9d0

Browse files
UFAL/Do not add dtoken into the URL if it is null (#860)
1 parent 199447c commit 8eec9d0

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/app/bitstream-page/clarin-zip-download-page/clarin-zip-download-page.component.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,8 +71,11 @@ export class ClarinZipDownloadPageComponent extends ClarinBitstreamDownloadPageC
7171
this.bitstreams$.next([...current, ...bitstreamsRD.payload.page]);
7272
this.bitstreamRD$ = createSuccessfulRemoteDataObject$(this.bitstreams$.getValue()[0]);
7373
this.dtoken = isUndefined(this.route.snapshot.queryParams.dtoken) ? null : this.route.snapshot.queryParams.dtoken;
74-
this.zipDownloadLink.next(this.halService.getRootHref() +
75-
`/core/items/${itemRD.payload.uuid}/allzip?handleId=${itemRD?.payload?.handle}&dtoken=${this.dtoken}`);
74+
const baseUrl = this.halService.getRootHref() +
75+
`/core/items/${itemRD.payload.uuid}/allzip?handleId=${itemRD?.payload?.handle}`;
76+
// Do not add `dtoken` into the URL if it is null
77+
const dtokenParam = this.dtoken ? `&dtoken=${this.dtoken}` : '';
78+
this.zipDownloadLink.next(baseUrl + dtokenParam);
7679
super.ngOnInit();
7780
}
7881
});

0 commit comments

Comments
 (0)