Skip to content

Commit

Permalink
Return a String in Headers#request_id
Browse files Browse the repository at this point in the history
  • Loading branch information
sshaw committed Oct 29, 2024
1 parent 8fae814 commit 8bc2acc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ customers = bc.customers.get
customers = bc.customers.get(:id => [1,2,3], :include => %w[addresses formfields])

p customers.meta.pagination.total
p customers.meta.headers.request_id
p customers.headers.request_id

# customers is Enumerable
customers.each do |customer|
Expand Down
3 changes: 2 additions & 1 deletion lib/big_commerce/management_api/endpoint.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@ def [](name)
end

def request_id
headers["x-request-id"]
value = @headers["x-request-id"]
value.is_a?(Array) ? value[0] : value
end

%w[x-rate-limit-requests-left
Expand Down

0 comments on commit 8bc2acc

Please sign in to comment.