Skip to content

Commit

Permalink
fix request method types to be a Symbol or a String
Browse files Browse the repository at this point in the history
  • Loading branch information
GrantBirki committed Aug 12, 2024
1 parent dc6a860 commit 0c507d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/octokit/connection.cr
Original file line number Diff line number Diff line change
Expand Up @@ -117,15 +117,15 @@ module Octokit
@agent = nil
end

protected def request(method : Symbol, path : String, options = nil)
protected def request(method : Symbol | String, path : String, options = nil)
path = File.join(endpoint, path) unless path.nil? || path.starts_with?("http")
options = options ? @connection_options.merge(options) : @connection_options
@last_response = response = agent.request(verb: method.to_s, uri: path, options: options)
handle_error(response)
response.body
end

protected def request(method : Symbol, path : String, options = nil, &)
protected def request(method : Symbol | String, path : String, options = nil, &)
path = File.join(endpoint, path) unless path.nil? || path.starts_with?("http")
options = options ? @connection_options.merge(options) : @connection_options
@last_response = response = agent.request(verb: method, uri: path, options: options)
Expand Down

0 comments on commit 0c507d7

Please sign in to comment.