Skip to content

Commit

Permalink
tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
jenbutongit committed Oct 21, 2024
1 parent 7e24792 commit b2e55a1
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions runner/src/server/services/upload/uploadService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -159,13 +159,9 @@ export class UploadService {
file: HapiReadableStream,
customAcceptedTypes?: string[]
) {
if (customAcceptedTypes) {
return customAcceptedTypes.includes(
file?.hapi?.headers?.["content-type"]
);
}
const acceptedTypes = customAcceptedTypes ?? this.validContentTypes;

return this.validContentTypes.has(file?.hapi?.headers?.["content-type"]);
return acceptedTypes.includes(file?.hapi?.headers?.["content-type"]);
}

invalidFileTypeError(fieldName: string, customAcceptedTypes?: string[]) {
Expand Down

0 comments on commit b2e55a1

Please sign in to comment.