Skip to content

_MultiPartBodyModel raises IndexError on empty form fields #1703

Description

@themavik

params/models.py around line 185 does data[0] and data[-1] on the raw form value. When a field is present but empty (field=), data is an empty string and indexing raises IndexError.

Happens on any multipart POST where a string-annotated field is submitted empty. A len check before indexing would fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions