mirror of
https://github.com/DI0IK/homepage-plus.git
synced 2025-07-08 22:48:46 +00:00
linting and cleanup
This commit is contained in:
parent
7f041e8303
commit
f74e8b9d32
51 changed files with 464 additions and 349 deletions
|
@ -1,10 +1,11 @@
|
|||
/* eslint-disable prefer-promise-reject-errors */
|
||||
import https from "https";
|
||||
import http from "http";
|
||||
|
||||
export function httpsRequest(url, params) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
var request = https.request(url, params, function (response) {
|
||||
var data = [];
|
||||
return new Promise((resolve, reject) => {
|
||||
const request = https.request(url, params, (response) => {
|
||||
const data = [];
|
||||
|
||||
response.on("data", (chunk) => {
|
||||
data.push(chunk);
|
||||
|
@ -24,9 +25,9 @@ export function httpsRequest(url, params) {
|
|||
}
|
||||
|
||||
export function httpRequest(url, params) {
|
||||
return new Promise(function (resolve, reject) {
|
||||
var request = http.request(url, params, function (response) {
|
||||
var data = [];
|
||||
return new Promise((resolve, reject) => {
|
||||
const request = http.request(url, params, (response) => {
|
||||
const data = [];
|
||||
|
||||
response.on("data", (chunk) => {
|
||||
data.push(chunk);
|
||||
|
@ -57,7 +58,6 @@ export function httpProxy(url, params = {}) {
|
|||
agent: httpsAgent,
|
||||
...params,
|
||||
});
|
||||
} else {
|
||||
return httpRequest(constructedUrl, params);
|
||||
}
|
||||
return httpRequest(constructedUrl, params);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue