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

[BUG] Multipart error when submitting with empty form-data #405

Closed
4 tasks done
phihung opened this issue Sep 7, 2024 · 0 comments
Closed
4 tasks done

[BUG] Multipart error when submitting with empty form-data #405

phihung opened this issue Sep 7, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@phihung
Copy link

phihung commented Sep 7, 2024

Error when submitting a multipart/form-data form without any data

Minimal Reproducible Example

@rt("/")
def home(): return Form(Input(name="a", type="checkbox"), Button("Submit"), hx_post="/process")
@rt
def process(x: dict): return f"Check box is {x.get('a', 'off')}"

Click on submit (without ticking the checkbox)

multipart.exceptions.MultipartParseError: Did not find CR at end of boundary

Workaround: Change Form.enctype

Form(..., enctype="")

Environment Information

  • fastlite version: 0.0.10
  • fastcore version: 1.7.4
  • fasthtml version: 0.5.1

Confirmation
Please confirm the following:

  • I have read the FAQ (https://docs.fastht.ml/explains/faq.html)
  • I have provided a minimal reproducible example
  • I have included the versions of fastlite, fastcore, and fasthtml
  • I understand that this is a volunteer open source project with no commercial support.
@phihung phihung added the bug Something isn't working label Sep 7, 2024
@jph00 jph00 closed this as completed in 9161779 Sep 14, 2024
alg747 pushed a commit to alg747/fasthtml that referenced this issue Sep 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant