Update packages, fix image errors not being properly thrown
This commit is contained in:
parent
57cd37d1eb
commit
db068cee60
4 changed files with 167 additions and 197 deletions
|
@ -25,7 +25,7 @@ const Rinit = 0x08;
|
|||
class ImageConnection {
|
||||
constructor(host, auth, tls = false) {
|
||||
this.requests = new Map();
|
||||
if(!host.includes(":")){
|
||||
if (!host.includes(":")) {
|
||||
host += ":3762";
|
||||
}
|
||||
this.host = host;
|
||||
|
@ -42,11 +42,11 @@ class ImageConnection {
|
|||
this.wsproto = "ws";
|
||||
}
|
||||
this.sockurl = `${this.wsproto}://${host}/sock`;
|
||||
let headers = {};
|
||||
if(auth){
|
||||
const headers = {};
|
||||
if (auth) {
|
||||
headers.Authentication = auth;
|
||||
}
|
||||
this.conn = new WebSocket(this.sockurl, {headers});
|
||||
this.conn = new WebSocket(this.sockurl, { headers });
|
||||
let httpproto;
|
||||
if (tls) {
|
||||
httpproto = "https";
|
||||
|
|
|
@ -131,6 +131,7 @@ class ImageWorker extends BaseServiceWorker {
|
|||
continue;
|
||||
} else {
|
||||
if (e === "No available servers" && i >= 2) throw "Request ended prematurely due to a closed connection";
|
||||
throw e;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue