Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 11 additions & 2 deletions endpoint.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,9 @@
package winrm

import (
"fmt"
"net"
"net/url"
"strconv"
"time"
)

Expand Down Expand Up @@ -37,7 +39,14 @@ func (ep *Endpoint) url() string {
scheme = "http"
}

return fmt.Sprintf("%s://%s:%d/wsman", scheme, ep.Host, ep.Port)
u := &url.URL{
Scheme: scheme,
Host: net.JoinHostPort(ep.Host, strconv.Itoa(ep.Port)),
Path: "/wsman",
}

return u.String()

}

// NewEndpoint returns new pointer to struct Endpoint, with a default 60s response header timeout
Expand Down
Loading