Prefix 127.0.0.1 to address if starts with :
This commit is contained in:
parent
b4987d514a
commit
fb115b280f
|
@ -543,7 +543,7 @@ dependencies = [
|
|||
|
||||
[[package]]
|
||||
name = "golgi"
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
dependencies = [
|
||||
"async-std",
|
||||
"async-stream 0.3.2",
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "golgi"
|
||||
version = "0.1.2"
|
||||
version = "0.1.3"
|
||||
edition = "2021"
|
||||
authors = ["Max Fowler <max@mfowler.info>", "Andrew Reid <glyph@mycelial.technology>"]
|
||||
readme = "README.md"
|
||||
|
|
|
@ -58,12 +58,16 @@ impl Sbot {
|
|||
ip_port: Option<String>,
|
||||
net_id: Option<String>,
|
||||
) -> Result<Sbot, GolgiError> {
|
||||
let address = if ip_port.is_none() {
|
||||
let mut address = if ip_port.is_none() {
|
||||
"127.0.0.1:8008".to_string()
|
||||
} else {
|
||||
ip_port.unwrap()
|
||||
};
|
||||
|
||||
if address.starts_with(":") {
|
||||
address = format!("127.0.0.1{}", address);
|
||||
}
|
||||
|
||||
let network_id = if net_id.is_none() {
|
||||
discovery::ssb_net_id()
|
||||
} else {
|
||||
|
|
Loading…
Reference in New Issue