Skip to content

Commit

Permalink
Merge pull request #1023 from isomerpages/release/0.53.0
Browse files Browse the repository at this point in the history
0.53.0
  • Loading branch information
kishore03109 authored Nov 9, 2023
2 parents cf18014 + 392b761 commit afd4ac3
Show file tree
Hide file tree
Showing 6 changed files with 23 additions and 11 deletions.
9 changes: 9 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,17 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v0.53.0](https://github.com/isomerpages/isomercms-backend/compare/v0.52.0...v0.53.0)

- fix(mediafileservice): disable sneky cloudmersive [`#1025`](https://github.com/isomerpages/isomercms-backend/pull/1025)
- fix(file ext): fix casing + better logging [`#1020`](https://github.com/isomerpages/isomercms-backend/pull/1020)
- fix(rr): capture file extensions that are in uppercase [`#1016`](https://github.com/isomerpages/isomercms-backend/pull/1016)
- release(0.52.0): merge to develop [`#1012`](https://github.com/isomerpages/isomercms-backend/pull/1012)

#### [v0.52.0](https://github.com/isomerpages/isomercms-backend/compare/v0.51.0...v0.52.0)

> 2 November 2023
- Feat/stagingBuildTimes [`#1008`](https://github.com/isomerpages/isomercms-backend/pull/1008)
- Fix/quickie/dbUpdate [`#1007`](https://github.com/isomerpages/isomercms-backend/pull/1007)
- fix(githubCOmmitService): add sane defaults [`#1010`](https://github.com/isomerpages/isomercms-backend/pull/1010)
Expand Down
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "isomercms",
"version": "0.52.0",
"version": "0.53.0",
"private": true,
"scripts": {
"build": "tsc -p tsconfig.build.json",
Expand Down
6 changes: 4 additions & 2 deletions src/services/db/GitFileSystemService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -811,8 +811,10 @@ export default class GitFileSystemService {
}

getMimeType(fileExtension: string): Result<string, MediaTypeError> {
if (!ALLOWED_FILE_EXTENSIONS.includes(fileExtension)) {
return err(new MediaTypeError("Unsupported file extension found"))
if (!ALLOWED_FILE_EXTENSIONS.includes(fileExtension.toLowerCase())) {
return err(
new MediaTypeError(`Unsupported file extension: ${fileExtension} found`)
)
}
switch (fileExtension) {
case "svg":
Expand Down
11 changes: 6 additions & 5 deletions src/services/fileServices/MdPageServices/MediaFileService.js
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,12 @@ class MediaFileService {
const fileBuffer = Buffer.from(fileContent, "base64")

// Scan file for virus - cloudmersive API
const virusScanRes = await scanFileForVirus(fileBuffer)
logger.info(`File scan result: ${virusScanRes.CleanResult}`)
if (!virusScanRes || !virusScanRes.CleanResult) {
throw new BadRequestError("File did not pass virus scan")
}
// TODO: Evaluate if we still
// const virusScanRes = await scanFileForVirus(fileBuffer)
// logger.info(`File scan result: ${virusScanRes.CleanResult}`)
// if (!virusScanRes || !virusScanRes.CleanResult) {
// throw new BadRequestError("File did not pass virus scan")
// }

// Sanitize and validate file
const sanitizedContent = await validateAndSanitizeFileUpload(content)
Expand Down
2 changes: 1 addition & 1 deletion src/services/review/ReviewRequestService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,7 +252,7 @@ export default class ReviewRequestService {
path,
}: PathInfo): Result<EditedMediaDto, PageParseError> => {
const fileExt = getFileExt(name)
if (ALLOWED_FILE_EXTENSIONS.includes(fileExt)) {
if (ALLOWED_FILE_EXTENSIONS.includes(fileExt.toLowerCase())) {
return ok({
name,
path: path.unwrapOr([""]),
Expand Down

0 comments on commit afd4ac3

Please sign in to comment.