fix (backend): host and hostname was messed up
This commit is contained in:
parent
d41b462a89
commit
f33c7c6c94
4 changed files with 9 additions and 9 deletions
|
@ -296,14 +296,14 @@ fn load_config() -> Config {
|
|||
let version = read_meta().version;
|
||||
let manifest = read_manifest();
|
||||
let url = url::Url::parse(&server_config.url).expect("Config url is invalid");
|
||||
let host = url
|
||||
let hostname = url
|
||||
.host_str()
|
||||
.expect("Hostname is missing in the config url")
|
||||
.to_owned();
|
||||
let hostname = url
|
||||
.domain()
|
||||
.expect("Domain is missing in the config url")
|
||||
.to_owned();
|
||||
let host = match url.port() {
|
||||
Some(port) => format!("{}:{}", hostname, port),
|
||||
None => hostname.clone(),
|
||||
};
|
||||
let scheme = url.scheme().to_owned();
|
||||
let ws_scheme = scheme.replace("http", "ws");
|
||||
|
||||
|
@ -320,7 +320,7 @@ fn load_config() -> Config {
|
|||
} else {
|
||||
server_config.redis.prefix.clone()
|
||||
}
|
||||
.unwrap_or(hostname.clone());
|
||||
.unwrap_or(host.clone());
|
||||
|
||||
Config {
|
||||
url: server_config.url,
|
||||
|
|
|
@ -22,7 +22,7 @@ export default class extends Channel {
|
|||
this.listId = params.listId as string;
|
||||
|
||||
// Check existence and owner
|
||||
const exist = await UserLists.exist({
|
||||
const exist = await UserLists.exists({
|
||||
where: {
|
||||
id: this.listId,
|
||||
userId: this.user!.id,
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { EventEmitter } from "events";
|
||||
import type { EventEmitter } from "node:events";
|
||||
import type * as websocket from "websocket";
|
||||
import readNote from "@/services/note/read.js";
|
||||
import type { User } from "@/models/entities/user.js";
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
import type { EventEmitter } from "events";
|
||||
import type { EventEmitter } from "node:events";
|
||||
import type Emitter from "strict-event-emitter-types";
|
||||
import type { Channel } from "@/models/entities/channel.js";
|
||||
import type { User } from "@/models/entities/user.js";
|
||||
|
|
Loading…
Reference in a new issue