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

Fix and test for invalid operations and map field types #139

Merged
merged 8 commits into from
Apr 5, 2019
Merged

Fix and test for invalid operations and map field types #139

merged 8 commits into from
Apr 5, 2019

Conversation

MickVanDuijn
Copy link
Contributor

@MickVanDuijn MickVanDuijn commented Apr 2, 2019

When operations is of type string, and operationsPath.set is called, the error was not correctly propagated.

@MickVanDuijn MickVanDuijn changed the title Add test and fix for wrongly typed ‘operations’ Fix and test for wrongly typed ‘operations’ (string instead of object) Apr 3, 2019
@@ -193,6 +197,14 @@ export const processRequest = (
createError(413, `${maxFiles} max file uploads exceeded.`)
)

if (typeof operations !== 'object')
Copy link
Owner

Choose a reason for hiding this comment

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

I'm not sure this check is necessary, because operations has already been checked at this point?

Still need to handle an invalid ‘map’ type.
@jaydenseric
Copy link
Owner

Thanks for bringing this up! I've handled a few issues (e.g. null is technically an object but should not be allowed for operations) and polished some things.

I'll take it from here, as the map field needs the same treatment. I've added a todo test.

`null` is more likely to reveal issues as it is technically an object.
@jaydenseric jaydenseric changed the title Fix and test for wrongly typed ‘operations’ (string instead of object) Fix and test for invalid operations and map field types. Apr 4, 2019
@jaydenseric jaydenseric changed the title Fix and test for invalid operations and map field types. Fix and test for invalid operations and map field types Apr 4, 2019
@MickVanDuijn
Copy link
Contributor Author

Thanks! This at least solved one of the problems I had, but null is another tricky one indeed! What would be the ETA for this to be in a new release?

@jaydenseric
Copy link
Owner

@MickVanDuijn I plan to release today.

@jaydenseric jaydenseric merged commit 6f01bb1 into jaydenseric:master Apr 5, 2019
@jaydenseric
Copy link
Owner

Thanks 🙌

@jaydenseric
Copy link
Owner

Published in v8.0.5 🚀

@MickVanDuijn
Copy link
Contributor Author

🚀 Thanks for the quick release!

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.

None yet

2 participants