Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

0.53.0 #1023

Merged
merged 7 commits into from
Nov 9, 2023
Merged

0.53.0 #1023

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading