This commit is contained in:
Jiiks 2019-03-05 21:26:36 +02:00
parent b68c1fbd04
commit d6a946e096
1 changed files with 18 additions and 1 deletions

View File

@ -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'
}
}
}