Skip to content

Commit 425172c

Browse files
fix: exits handlers loop if response is returned (#13866)
Fixes #13762 Adjusts custom upload handlers for loop to match the documentation, exiting the loop if a response is returned.
1 parent 667c4f1 commit 425172c

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

packages/payload/src/uploads/endpoints/getFile.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ export const getFileHandler: PayloadHandler = async (req) => {
4949
filename,
5050
},
5151
})
52+
if (customResponse && customResponse instanceof Response) {
53+
break
54+
}
5255
}
5356

5457
if (customResponse instanceof Response) {

0 commit comments

Comments
 (0)