-
-
Notifications
You must be signed in to change notification settings - Fork 62
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
MultipartParseError when parsing empty message #38
Comments
Confirming it. Reproduced during parsing of form with all optional fields (useful for |
I'm getting this same error from a starlette-admin webapp: jowilf/starlette-admin#262 Sample code: class ArticleView(ModelView):
actions = ['test', 'delete']
@action(
name='test',
text='Test',
confirmation='Are you sure?',
form="""
<form>
<input type="checkbox" id="check" name="check">
<label for="check">Breaks unless you check it</label>
</form>
""",
)
async def make_published_action(self, request: Request, pks: List[Any]) -> str:
data: FormData = await request.form()
print(data) When the This also happens with |
I finally found a workaround: include a <form>
<input type="checkbox" id="check" name="check">
<label for="check">Doesn't break, thanks to hidden value!</label>
<input type="hidden" name="_" value="">
</form> Works even when value is I'm assuming it's something about parsing a completely empty form, since |
any updates on this? |
Parsing an empty message, i.e. a message with only the final boundary, raises MultipartParseError in
MultipartParser._internal_write
:How to reproduce (ed8c47a):
Firefox and Chrome produce empty messages like this, e.g. when POSTing a HTML form with only a unchecked checkbox.
The text was updated successfully, but these errors were encountered: