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

Add multipart fix when does not exist any body #905

Merged
merged 1 commit into from
Feb 21, 2024

Conversation

hiuxmaycry
Copy link
Contributor

Context in our project we have endpoints in which there is no type of body parser involved, so req.body is always undefined for those requests. This happens because the body is not consumed on the server but is simply forwarded to another API (Our API is just a proxy to another API).

Therefore, we do not validate the content of the file in any way, we only check that the endpoint exists in the SPEC.

That said, we validate that the multipartNested function is only applied when the body exists so as not to generate an error of TypeError: Cannot convert undefined or null to object.

@@ -13,19 +13,22 @@ export async function createApp(
port = 3000,
customRoutes = (app) => {},
useRoutes = true,
apiRouter = undefined,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Parameter was not used

@@ -216,7 +220,6 @@ export class RequestValidator {
}
}
});
return null;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

redundant return 🙂

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function return it is not used

@hiuxmaycry
Copy link
Contributor Author

Hi @cdimascio, can you please review this? 🙂

@cdimascio cdimascio merged commit 5c98d17 into cdimascio:master Feb 21, 2024
5 checks passed
@hiuxmaycry
Copy link
Contributor Author

Hi @cdimascio sorry for the inconvenience, do we have an ETA on when this fix will be released?

@guillerecalde
Copy link
Contributor

Hey @cdimascio, any chance you have an ETA for when this fix will be released? Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants