Skip to content

Commit 2a1068b

Browse files
committed
Force fresh bitstream fetch to avoid stale SSR 404s
1 parent 6628aaf commit 2a1068b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/app/bitstream-page/bitstream-page.resolver.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ export class BitstreamPageResolver implements Resolve<RemoteData<Bitstream>> {
3232
* or an error if something went wrong
3333
*/
3434
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<RemoteData<Bitstream>> {
35-
return this.bitstreamService.findById(route.params.id, true, false, ...this.followLinks)
35+
// Use useCachedVersionIfAvailable=false so that the request is always re-sent with the
36+
// current user's authentication. This prevents stale 404 responses (e.g. from SSR where
37+
// the user may not be authenticated) from being reused on the client side.
38+
return this.bitstreamService.findById(route.params.id, false, true, ...this.followLinks)
3639
.pipe(
3740
getFirstCompletedRemoteData(),
3841
);

0 commit comments

Comments
 (0)