Skip to content

Fail to handle header with blank value #60

@zhuochen83

Description

@zhuochen83

The regex at line 28 does not handle header with a blank value.

Here is my test of the regex

var headers = "Server: \r\nmy-header: my-value\r\n";
headers.replace(/^(.?):\s([\s\S]*?)$/gm, (m, key, value) => {
console.log(key + ' | ' + value);
})

Expecting
"Server | "
"my-header | my-value"
Actual
"Server | my-header: my-value"

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