Skip to content

urequests: miscalculation of Content-Length when dealling with unicode data #251

Open
@7th-heaven

Description

@7th-heaven

code in urequests ver 0.5.1:
s.write(b"Content-Length: %d\r\n" % len(data))

"len" calcs a single unicode as 1 length.
to correct it. encode the data before calcs the length
as: s.write(b"Content-Length: %d\r\n" % len(data.encode('')))
plz fix it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions