Skip to content

Commit

Permalink
Allow setting extra headers
Browse files Browse the repository at this point in the history
  • Loading branch information
will committed Jun 14, 2022
1 parent 4b8f5e8 commit cafeaeb
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/cb/client.cr
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,10 @@ class CB::Client
"Authorization" => "Bearer #{token.token}",
"User-Agent" => CB::VERSION_STR,
}

ENV.select { |k, _| k.starts_with? "X_CRUNCHY_" }.each { |k, v|
@headers.add k.split('_').map(&.titleize).join('-'), v
}
end

def http : HTTP::Client
Expand Down

0 comments on commit cafeaeb

Please sign in to comment.