Skip to content

Not showing binary request data by Content-Type for httpclient adapter#53

Closed
Qwertyn wants to merge 2 commits intotrusche:masterfrom
Qwertyn:not_log_request_data_by_content_type_httpclient_adapter
Closed

Not showing binary request data by Content-Type for httpclient adapter#53
Qwertyn wants to merge 2 commits intotrusche:masterfrom
Qwertyn:not_log_request_data_by_content_type_httpclient_adapter

Conversation

@Qwertyn
Copy link
Copy Markdown

@Qwertyn Qwertyn commented Dec 2, 2017

No description provided.

Copy link
Copy Markdown
Owner

@trusche trusche left a comment

Choose a reason for hiding this comment

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

Thanks for this, but it's breaking a bunch of tests, and also introduces differences between httpclient and the other adapters. I'll happily accept this if it's consistent across all adapters and comes with a new test for the new behaviour.

Comment thread lib/httplog/http_log.rb
def log_data(data)
def log_data(data, content_type = nil)
return if config.compact_log || !config.log_data
unless text_based?(content_type)
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

This is breaking all other adapters, since they're not passing in the request content type, and the default nil will not be treated as text based.

@Qwertyn
Copy link
Copy Markdown
Author

Qwertyn commented Dec 4, 2017

Fix test for ethon, excon, http, patron adapters.
There were difficulties with the adapter Net::HTTP.
help me please...

@trusche
Copy link
Copy Markdown
Owner

trusche commented Dec 6, 2017

Cheers. It looks like Net::HTTP passes the content type differently to post requests (with a symbol :content_type as the hash key). I'll try to resolve it, but I'm a bit short on time these days, so it may take a bit.

@trusche trusche closed this Oct 22, 2018
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