Skip to content

Commit

Permalink
Fix capitalization for header auth keys
Browse files Browse the repository at this point in the history
  • Loading branch information
oblakeerickson committed May 15, 2019
1 parent 19691de commit 64476cc
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions lib/discourse_api/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ def initialize(host, api_key = nil, api_username = nil)

def api_username=(api_username)
@api_username = api_username
@connection.headers['Api-username'] = api_username unless @connection.nil?
@connection.headers['Api-Username'] = api_username unless @connection.nil?
end

def connection_options
Expand Down Expand Up @@ -122,8 +122,8 @@ def connection
conn.adapter Faraday.default_adapter
#pass api_key and api_username on every request
unless api_username.nil?
conn.headers['Api-key'] = api_key
conn.headers['Api-username'] = api_username
conn.headers['Api-Key'] = api_key
conn.headers['Api-Username'] = api_username
end
end
end
Expand Down

0 comments on commit 64476cc

Please sign in to comment.