Skip to content

Reason phrase from status line ignored #465

Open
@sergiorjsd

Description

@sergiorjsd

Hi!

To be fair I don't know why but an API that I am consuming is giving me some errors in the HTTP Status-Line at the Reason-Phrase.

Errors like this one: HTTP/1.1 400 05 Integer 12345678 exceeds maximum value of 9999999.

It's the first time I see this kind of thing and I suppose that it's not correct but I need to handle these kind of errors for my application.

To make my API requests I'm using Req and digging into the code to search for a solution I've found that it uses Finch and Mint at the end. Here is where I've found that the Reason-Phrase is parsed but also ignored at some point later.

Line where reason is present but ignored:

mint/lib/mint/http1.ex

Lines 647 to 649 in 90ee9fd

defp decode(:status, %{request: request} = conn, data, responses) do
case Response.decode_status_line(data) do
{:ok, {version, status, _reason}, rest} ->

Should we propagate it? It's my first time here but I think I can make a PR if needed.

Thanks in advance!

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions