You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Currently, in the create_post() and update_post() functions, we don't have error handling for incase the user provides input json data with any key other that 'msg'.
For example, the request body is { "text": "Hello world!" }, this would not be valid, and a 400 BAD_REQUEST error should be thrown.
A check similar to the professors code should suffice.
if 'times' not in o or not isinstance(o['times'], int) or o['times'] <= 0:
return { 'err': 'expected positive int-valued "times" field' }, 400