Skip to content

Commit de3e481

Browse files
committed
Use Authorization header instead of X-Meili-API-Key (#275)
1 parent 9b0e5f9 commit de3e481

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/meilisearch/http_request.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ def http_delete(relative_path = '')
6262
def build_default_options_headers(api_key = nil)
6363
{
6464
'Content-Type' => 'application/json',
65-
'X-Meili-API-Key' => api_key
65+
'Authorization' => "Bearer #{api_key}"
6666
}.compact
6767
end
6868

spec/meilisearch/index/base_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
expect(MeiliSearch::Index).to receive(:get).with(
100100
"#{URL}/indexes/options",
101101
{
102-
headers: { 'X-Meili-API-Key' => MASTER_KEY },
102+
headers: { 'Authorization' => "Bearer #{MASTER_KEY}" },
103103
body: 'null',
104104
query: {},
105105
max_retries: 1,

0 commit comments

Comments
 (0)