Skip to content

Commit

Permalink
Allow files with uppercase file formats. Maintain casing from point o…
Browse files Browse the repository at this point in the history
…f upload. (#1812)
  • Loading branch information
andrewwallacespeckle authored Oct 6, 2023
1 parent 76cef61 commit 6052be2
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion packages/frontend-2/lib/core/helpers/file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function validateFileType(
if (!fileExt) return new MissingFileExtensionError()

for (const allowedExtension of allowedExtensions) {
if (allowedExtension === fileExt) return true
if (allowedExtension === fileExt.toLowerCase()) return true
}

return new ForbiddenFileTypeError()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export function validateFileType(
if (!fileExt) return new MissingFileExtensionError()

for (const allowedExtension of allowedExtensions) {
if (allowedExtension === fileExt) return true
if (allowedExtension === fileExt.toLowerCase()) return true
}

return new ForbiddenFileTypeError()
Expand Down
2 changes: 1 addition & 1 deletion packages/server/modules/fileuploads/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ exports.init = async (app) => {
'/api/file/:fileType/:streamId/:branchName?',
authMiddlewareCreator(streamWritePermissions),
async (req, res) => {
const branchName = (req.params.branchName || 'main').toLowerCase()
const branchName = req.params.branchName || 'main'
req.log = req.log.child({
streamId: req.params.streamId,
userId: req.context.userId,
Expand Down

0 comments on commit 6052be2

Please sign in to comment.