aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/middlewares/validators
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2023-06-01 10:43:36 +0200
committerChocobozzz <me@florianbigard.com>2023-06-29 09:49:06 +0200
commit1fb7d094229acdc190c3f7551b43ac5445814dee (patch)
tree46cb0d43d450ac5320bfaae2ee5e2d03b6ae9dbc /server/middlewares/validators
parent866c5f667da9fc09f3b093ff0a6f89d4af0ce5af (diff)
downloadPeerTube-1fb7d094229acdc190c3f7551b43ac5445814dee.tar.gz
PeerTube-1fb7d094229acdc190c3f7551b43ac5445814dee.tar.zst
PeerTube-1fb7d094229acdc190c3f7551b43ac5445814dee.zip
Don't cache upload after video deletion
Diffstat (limited to 'server/middlewares/validators')
-rw-r--r--server/middlewares/validators/videos/videos.ts12
1 files changed, 8 insertions, 4 deletions
diff --git a/server/middlewares/validators/videos/videos.ts b/server/middlewares/validators/videos/videos.ts
index 7f1f39b11..fc2f95aa5 100644
--- a/server/middlewares/validators/videos/videos.ts
+++ b/server/middlewares/validators/videos/videos.ts
@@ -132,11 +132,15 @@ const videosAddResumableValidator = [
132 }) 132 })
133 } 133 }
134 134
135 if (isTestInstance()) { 135 const videoStillExists = await VideoModel.load(sessionResponse.video.id)
136 res.setHeader('x-resumable-upload-cached', 'true') 136
137 } 137 if (videoStillExists) {
138 if (isTestInstance()) {
139 res.setHeader('x-resumable-upload-cached', 'true')
140 }
138 141
139 return res.json(sessionResponse) 142 return res.json(sessionResponse)
143 }
140 } 144 }
141 145
142 await Redis.Instance.setUploadSession(uploadId) 146 await Redis.Instance.setUploadSession(uploadId)