Skip to content
This repository was archived by the owner on Sep 29, 2022. It is now read-only.
This repository was archived by the owner on Sep 29, 2022. It is now read-only.

HttpRequest构造函数在获取Request Body时进入死循环 #30

@xmyhhh

Description

@xmyhhh
        if (int.TryParse(contentLength, out var length) && Body.Length != length)
        {
            do
            {
                length = stream.Read(bytes, 0, MAX_SIZE - 1);
                Body += Encoding.UTF8.GetString(bytes, 0, length);
            } while (Body.Length != length);
        }

这段代中的while循环跳出不来,如果MAX_SIZE很大,则 length始终为0;如果MAX_SIZE很大,则 Body.Length 始终大于 length。

当我用multipart/form-data POST 上传图片时发生

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