Skip to content

Commit

Permalink
[lib/Handler] fix incorrect header
Browse files Browse the repository at this point in the history
we're using Token yet we use Authorization

Signed-off-by: Kibo Hikari <[email protected]>
  • Loading branch information
sr229 committed Aug 9, 2019
1 parent dd5730a commit a1354f5
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/Handler.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const request = require("./Request");
module.exports = class {
/**
*
* @param {String} token your API token.
* @param {String} token your API Authorization.
* @see {link} https://sayonika.maidcafe.cf/developers
*/
constructor(token) {
Expand All @@ -28,7 +28,7 @@ module.exports = class {
*/
getMod(id) {
return new Promise((resolve, reject) => {
request("GET", `https://sayonika.maidcafe.cf/api/v1/mods/${id}`, {headers: {Token: this.token}}).then(res => {
request("GET", `https://sayonika.maidcafe.cf/api/v1/mods/${id}`, {headers: {Authorization: this.token}}).then(res => {
resolve(res.body);
}).catch(reject);
});
Expand All @@ -41,7 +41,7 @@ module.exports = class {
*/
getAllMods(page) {
return new Promise((resolve, reject) => {
request('GET', `https://sayonika.maidcafe.cf/api/v1/mods?page=${page}`, {headers: {Token: this.token}}).then(res => {
request('GET', `https://sayonika.maidcafe.cf/api/v1/mods?page=${page}`, {headers: {Authorization: this.token}}).then(res => {
resolve(res.body);
}).catch(reject);
});
Expand All @@ -54,7 +54,7 @@ module.exports = class {
*/
getUser(id) {
return new Promise((resolve, reject) => {
request("GET", `https://sayonika.maidcafe.cf/api/v1/users/${id}`, {headers: {Token: this.token}}).then(res => {
request("GET", `https://sayonika.maidcafe.cf/api/v1/users/${id}`, {headers: {Authorization: this.token}}).then(res => {
resolve(res.body);
}).catch(reject);
});
Expand All @@ -67,7 +67,7 @@ module.exports = class {
*/
getAllUsers(page) {
return new Promise((resolve, reject) => {
request('GET', `https://sayonika.maidcafe.cf/api/v1/users?page=${page}`, {headers: {Token: this.token}}).then(res => {
request('GET', `https://sayonika.maidcafe.cf/api/v1/users?page=${page}`, {headers: {Authorization: this.token}}).then(res => {
resolve(res.body);
}).catch(reject);
});
Expand Down

0 comments on commit a1354f5

Please sign in to comment.