mirror of
https://github.com/remix-bot/fluxer.git
synced 2026-11-24 06:01:44 -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
|
* @returns {Promise<object>} Parsed JSON response
|
||||||
*/
|
*/
|
||||||
async function apiCall(params, apiSecret, post = false) {
|
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.api_sig = buildSignature(allParams, apiSecret);
|
||||||
|
allParams.format = "json"; // add AFTER signature
|
||||||
|
|
||||||
const url = post ? BASE_URL : `${BASE_URL}?${new URLSearchParams(allParams)}`;
|
const url = post ? BASE_URL : `${BASE_URL}?${new URLSearchParams(allParams)}`;
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user