Skip to content

Commit

Permalink
feat(transport/http): add some debug
Browse files Browse the repository at this point in the history
  • Loading branch information
stakach committed Oct 23, 2023
1 parent 3f310b1 commit 34bc8ec
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion shard.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: placeos-driver
version: 6.9.10
version: 6.9.11
crystal: ">= 1.0.0"

dependencies:
Expand Down
1 change: 1 addition & 0 deletions src/placeos-driver/transport.cr
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ abstract class PlaceOS::Driver::Transport
# Make the request
client = new_http_client(uri, context)
cookies.add_request_headers(headers) unless @settings.get { setting?(Bool, :disable_cookies) } || false
logger.debug { "http helper requesting: #{method.to_s.upcase} #{uri.request_target}" }
check_http_response_encoding client.exec(method.to_s.upcase, uri.request_target, headers, body).tap { client.close }
{% end %}
end
Expand Down
2 changes: 2 additions & 0 deletions src/placeos-driver/transport/http.cr
Original file line number Diff line number Diff line change
Expand Up @@ -254,6 +254,8 @@ class PlaceOS::Driver
headers = headers.is_a?(Hash) ? HTTP::Headers.new.tap { |head| headers.map { |key, value| head[key] = value } } : headers
cookies.add_request_headers(headers) unless @settings.get { setting?(Bool, :disable_cookies) } || false

logger.debug { "http transport requesting: #{method.to_s.upcase} #{uri.request_target}" }

# Make the request
response = if concurrent || @max_requests.zero?
# Does this request require a TLS context?
Expand Down

0 comments on commit 34bc8ec

Please sign in to comment.