mirror of
https://github.com/mikedilger/gossip.git
synced 2024-09-29 16:31:18 +00:00
If scheme is 'ws', fetch nip-11 via 'http' not 'https'
This commit is contained in:
parent
7a6af500a4
commit
fd38bebd0f
@ -94,6 +94,11 @@ impl Minion {
|
|||||||
// Connect to the relay
|
// Connect to the relay
|
||||||
let websocket_stream = {
|
let websocket_stream = {
|
||||||
let uri: http::Uri = self.url.0.parse::<Uri>()?;
|
let uri: http::Uri = self.url.0.parse::<Uri>()?;
|
||||||
|
let scheme_str = match uri.scheme_str() {
|
||||||
|
Some("wss") => "https",
|
||||||
|
Some("ws") => "http",
|
||||||
|
_ => "https",
|
||||||
|
};
|
||||||
let authority = uri.authority().ok_or(Error::UrlHasNoHostname)?.as_str();
|
let authority = uri.authority().ok_or(Error::UrlHasNoHostname)?.as_str();
|
||||||
let host = authority
|
let host = authority
|
||||||
.find('@')
|
.find('@')
|
||||||
@ -111,7 +116,7 @@ impl Minion {
|
|||||||
.brotli(true)
|
.brotli(true)
|
||||||
.deflate(true)
|
.deflate(true)
|
||||||
.build()?
|
.build()?
|
||||||
.get(format!("https://{}", host))
|
.get(format!("{}://{}", scheme_str, host))
|
||||||
.header("Accept", "application/nostr+json")
|
.header("Accept", "application/nostr+json")
|
||||||
.send();
|
.send();
|
||||||
let response = request_nip11_future.await?;
|
let response = request_nip11_future.await?;
|
||||||
|
Loading…
Reference in New Issue
Block a user