aboutsummaryrefslogtreecommitdiffhomepage
path: root/client/src/app/+videos/+video-watch/video-watch.component.ts
diff options
context:
space:
mode:
Diffstat (limited to 'client/src/app/+videos/+video-watch/video-watch.component.ts')
-rw-r--r--client/src/app/+videos/+video-watch/video-watch.component.ts13
1 files changed, 5 insertions, 8 deletions
diff --git a/client/src/app/+videos/+video-watch/video-watch.component.ts b/client/src/app/+videos/+video-watch/video-watch.component.ts
index c757a5e93..b698d554f 100644
--- a/client/src/app/+videos/+video-watch/video-watch.component.ts
+++ b/client/src/app/+videos/+video-watch/video-watch.component.ts
@@ -404,7 +404,7 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
404 this.videoCaptionService.listCaptions(videoId) 404 this.videoCaptionService.listCaptions(videoId)
405 ]) 405 ])
406 .pipe( 406 .pipe(
407 // If 401, the video is private or blocked so redirect to 404 407 // If 400, 403 or 404, the video is private or blocked so redirect to 404
408 catchError(err => { 408 catchError(err => {
409 if (err.body.errorCode === ServerErrorCode.DOES_NOT_RESPECT_FOLLOW_CONSTRAINTS && err.body.originUrl) { 409 if (err.body.errorCode === ServerErrorCode.DOES_NOT_RESPECT_FOLLOW_CONSTRAINTS && err.body.originUrl) {
410 const search = window.location.search 410 const search = window.location.search
@@ -416,9 +416,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
416 $localize`Redirection` 416 $localize`Redirection`
417 ).then(res => { 417 ).then(res => {
418 if (res === false) { 418 if (res === false) {
419 return this.restExtractor.redirectTo404IfNotFound(err, [ 419 return this.restExtractor.redirectTo404IfNotFound(err, 'video', [
420 HttpStatusCode.BAD_REQUEST_400, 420 HttpStatusCode.BAD_REQUEST_400,
421 HttpStatusCode.UNAUTHORIZED_401,
422 HttpStatusCode.FORBIDDEN_403, 421 HttpStatusCode.FORBIDDEN_403,
423 HttpStatusCode.NOT_FOUND_404 422 HttpStatusCode.NOT_FOUND_404
424 ]) 423 ])
@@ -428,9 +427,8 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
428 }) 427 })
429 } 428 }
430 429
431 return this.restExtractor.redirectTo404IfNotFound(err, [ 430 return this.restExtractor.redirectTo404IfNotFound(err, 'video', [
432 HttpStatusCode.BAD_REQUEST_400, 431 HttpStatusCode.BAD_REQUEST_400,
433 HttpStatusCode.UNAUTHORIZED_401,
434 HttpStatusCode.FORBIDDEN_403, 432 HttpStatusCode.FORBIDDEN_403,
435 HttpStatusCode.NOT_FOUND_404 433 HttpStatusCode.NOT_FOUND_404
436 ]) 434 ])
@@ -464,10 +462,9 @@ export class VideoWatchComponent implements OnInit, OnDestroy {
464 462
465 this.playlistService.getVideoPlaylist(playlistId) 463 this.playlistService.getVideoPlaylist(playlistId)
466 .pipe( 464 .pipe(
467 // If 401, the video is private or blocked so redirect to 404 465 // If 400 or 403, the video is private or blocked so redirect to 404
468 catchError(err => this.restExtractor.redirectTo404IfNotFound(err, [ 466 catchError(err => this.restExtractor.redirectTo404IfNotFound(err, 'video', [
469 HttpStatusCode.BAD_REQUEST_400, 467 HttpStatusCode.BAD_REQUEST_400,
470 HttpStatusCode.UNAUTHORIZED_401,
471 HttpStatusCode.FORBIDDEN_403, 468 HttpStatusCode.FORBIDDEN_403,
472 HttpStatusCode.NOT_FOUND_404 469 HttpStatusCode.NOT_FOUND_404
473 ])) 470 ]))