Skip to content

Commit

Permalink
headers
Browse files Browse the repository at this point in the history
  • Loading branch information
Jiiks committed Mar 5, 2019
1 parent b68c1fb commit d6a946e
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion common/modules/axi.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,29 @@ export default class AxiosWrapper {
);
}

static get zl() {
return this._zl ? this._zl : (this._zl = {
api: this.create('https://zl', 1000, this.zlHeaders),
cdn: this.create('https://zl', 1000, this.zlHeaders)
});
}

static create(baseUrl, timeout = 1000, headers = null) {
return axios.create({ baseURL: baseUrl, timeout, headers: headers ? headers : this.defaultHeaders });
}

static get defaultHeaders() {
return {};
return {
'User-Agent': 'BetterDiscordApp User'
};
}

static get zlHeaders() {
return {
'User-Agent': 'BetterDiscordApp User',
'X-ZL-Apikey': '1a20cce89a2dbd163fc9570f3246c20891e62b2818ada55f82fa3d1d96fa7ef4',
'X-ZL-User': 'anonymous'
}
}

}

0 comments on commit d6a946e

Please sign in to comment.