Skip to content

Conversation

@pkgodara
Copy link
Contributor

@pkgodara pkgodara commented Oct 19, 2025

Closes #465

Currently, we are ignoring the reason-phrase from status-line.
For backward compatibility, this is an optional parameter.
This PR adds an option at the connection time, that will return the reason-phrase in the response.

The first line of a response message is the status-line, consisting of the protocol version, a space (SP), 
the status code, and another space and ending with an OPTIONAL textual phrase describing the status code.

status-line = HTTP-version SP status-code SP [ reason-phrase ]

@coveralls
Copy link

coveralls commented Oct 20, 2025

Pull Request Test Coverage Report for Build 589a11aadabf3b16e7cad7c8295cb8381570e43d-PR-471

Details

  • 10 of 10 (100.0%) changed or added relevant lines in 1 file are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.08%) to 87.78%

Totals Coverage Status
Change from base Build 8f95bc73c13ce1ae058e0c69f035d8d345f96fe9: 0.08%
Covered Lines: 1293
Relevant Lines: 1473

💛 - Coveralls

Copy link
Contributor

@whatyouhide whatyouhide left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fantastic! 🫶

Comment on lines +134 to +139
* `:optional_responses` - (list of atoms) a list of optional responses to return.
The possible values in the list are -
* `:status_reason` which will return the
[reason-phrase](https://datatracker.ietf.org/doc/html/rfc9112#name-status-line)
for the status code, if it is returned by the server in status-line.
This is only available for HTTP/1.1 connections. *Available since v1.7.2*.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* `:optional_responses` - (list of atoms) a list of optional responses to return.
The possible values in the list are -
* `:status_reason` which will return the
[reason-phrase](https://datatracker.ietf.org/doc/html/rfc9112#name-status-line)
for the status code, if it is returned by the server in status-line.
This is only available for HTTP/1.1 connections. *Available since v1.7.2*.
* `:optional_responses` - (list of atoms) a list of optional responses to return.
Defaults to `[]`. The possible values in the list are:
* `:status_reason`: will include the
[reason-phrase](https://datatracker.ietf.org/doc/html/rfc9112#name-status-line)
for the status code (if it is returned by the server in status-line) in the response.
This is only available for HTTP/1.1 connections. *Available since v1.7.2*.

@whatyouhide whatyouhide merged commit 1ab3eeb into elixir-mint:main Oct 21, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Reason phrase from status line ignored

4 participants