mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-23 21:52:45 -05:00
fixing
This commit is contained in:
1 parent
8ac0dde343
commit
71b79e7f38
1 file changed
+4
-1
@@ -39,8 +39,11 @@ function buildSignature(params, apiSecret) {
|
||||
* @returns {Promise<object>} Parsed JSON response
|
||||
*/
|
||||
async function apiCall(params, apiSecret, post = false) {
|
||||
const allParams = { ...params, format: "json" };
|
||||
// Per Last.fm spec: format must NOT be included in the signature.
|
||||
// See: https://www.last.fm/api/authspec#_8-signing-calls
|
||||
const allParams = { ...params };
|
||||
allParams.api_sig = buildSignature(allParams, apiSecret);
|
||||
allParams.format = "json"; // add AFTER signature
|
||||
|
||||
const url = post ? BASE_URL : `${BASE_URL}?${new URLSearchParams(allParams)}`;
|
||||
|
||||
|
||||
Reference in new issue
Block a user