Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Preserve case of reason phrase from the actual server response #1320

Merged

Conversation

andersjaensson
Copy link
Contributor

@andersjaensson andersjaensson commented Apr 29, 2022

Description

Some servers respond with an upper case reason phrase.

logbook-httpclient5 uses fixed reason phrase strings from org.zalando.logbook.HttpResponse.
This PR makes it take the reason phrase from the actual server response instead.

Example:

A request to https://httpbin.org/status/400

$ curl --head httpbin.org/status/400
HTTP/1.1 400 BAD REQUEST

will currently be logged like this by logbook:

HTTP/1.1 400 Bad Request

This change will make it log like this instead:

HTTP/1.1 400 BAD REQUEST

I guess this can possibly be considered a breaking change.

Motivation and Context

I want the log to be as close to the actual server response as possible.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.

@whiskeysierra
Copy link
Collaborator

@andersjaensson Can you rebase onto master to trigger a fresh build? The pipeline didn't run for some reason...

@whiskeysierra
Copy link
Collaborator

👍

@whiskeysierra whiskeysierra merged commit 30b1676 into zalando:main Feb 22, 2023
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.

2 participants