Skip to content

Commit 503eb21

Browse files
committed
fix(core): make sure api key is sent as body if > 500 chars
This wasn't the case in the latest patch, because `withAPIKey` is not the same as `withApiKey`. I thought the bug was way worse before I selected the text and wondered why there were only two 'matches' in my editor, rather than three, which I knew was the case. Anyway, long story short, it was just a typo fixes #647
1 parent 7ace33b commit 503eb21

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/AlgoliaSearchCore.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ AlgoliaSearchCore.prototype._getSearchParams = function(args, params) {
488488
* Compute the headers for a request
489489
*
490490
* @param [string] options.additionalUA semi-colon separated string with other user agents to add
491-
* @param [boolean=true] options.withAPIKey Send the api key as a header
491+
* @param [boolean=true] options.withApiKey Send the api key as a header
492492
* @param [Object] options.headers Extra headers to send
493493
*/
494494
AlgoliaSearchCore.prototype._computeRequestHeaders = function(options) {
@@ -507,7 +507,7 @@ AlgoliaSearchCore.prototype._computeRequestHeaders = function(options) {
507507
// but in some situations, the API KEY will be too long (big secured API keys)
508508
// so if the request is a POST and the KEY is very long, we will be asked to not put
509509
// it into headers but in the JSON body
510-
if (options.withAPIKey !== false) {
510+
if (options.withApiKey !== false) {
511511
requestHeaders['x-algolia-api-key'] = this.apiKey;
512512
}
513513

0 commit comments

Comments
 (0)