toolbox icon indicating copy to clipboard operation
toolbox copied to clipboard

MaxJSONSize and MaxXMLSize must be greater than zero

Open mstgnz opened this issue 1 year ago • 2 comments

Hello,

I have thoroughly enjoyed watching almost all of your courses on Udemy. First and foremost, thank you very, very much for these valuable lessons.

I was following your Tools package course, and a question arose in my mind regarding Json. Therefore, I forked the Toolbox project and tested the issue that puzzled me.

It seems that if MaxJSONSize and MaxXMLSize values are not equal to zero, they are being paired with defaultMaxUpload. In the tests, since these values are always positive numbers, the tests were successful. However, when a negative value was entered, it was not equal to zero, so the entered negative value was assigned, causing the tests to fail.

Therefore, instead of checking whether MaxJSONSize and MaxXMLSize values are equal to zero, I checked whether they are greater than zero. This way, even if a negative value is entered, the tests are successful. Of course, alternatively, it could be considered to return an error by checking whether MaxJSONSize and MaxXMLSize values are less than zero. You know better which approach is more effective.

Since there is no explanation about contributing, I hesitated about the pull request. Nevertheless, I thought I would try my luck.

mstgnz avatar Dec 24 '23 13:12 mstgnz

Hi @tsawler

I integrated the InArray and LoadSQLQueries methods into the tools package.

InArray can check if the searched key exists in all arrays, regardless of their type.

LoadSQLQueries allows us to use SQL codes in SQL files instead of using them in code, thus avoiding code pollution.

I thought it would be good to have them in a toolbox.

mstgnz avatar Dec 28 '23 22:12 mstgnz

Thanks for this. I'll give it a look as soon as I can.

tsawler avatar Dec 29 '23 10:12 tsawler