fix: use hostname instead of host in gemini network connection
This commit is contained in:
@@ -45,12 +45,12 @@ func ConnectAndGetData(url string) ([]byte, error) {
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return nil, fmt.Errorf("Could not parse URL, error %w", err)
|
return nil, fmt.Errorf("Could not parse URL, error %w", err)
|
||||||
}
|
}
|
||||||
host := parsedUrl.Host
|
hostname := parsedUrl.Hostname()
|
||||||
port := parsedUrl.Port()
|
port := parsedUrl.Port()
|
||||||
if port == "" {
|
if port == "" {
|
||||||
port = "1965"
|
port = "1965"
|
||||||
host = fmt.Sprintf("%s:%s", host, port)
|
|
||||||
}
|
}
|
||||||
|
host := fmt.Sprintf("%s:%s", hostname, port)
|
||||||
// Establish the underlying TCP connection.
|
// Establish the underlying TCP connection.
|
||||||
dialer := &net.Dialer{
|
dialer := &net.Dialer{
|
||||||
Timeout: time.Duration(config.CONFIG.ResponseTimeout) * time.Second,
|
Timeout: time.Duration(config.CONFIG.ResponseTimeout) * time.Second,
|
||||||
|
|||||||
Reference in New Issue
Block a user