Skip to content

Commit 473d769

Browse files
author
Aaron Schlesinger
committed
fix(pkg/gitreceive/storage/endpoint.go): add a FullURL() func
to get the full URL of the endpoint. it will be used later
1 parent 773df6b commit 473d769

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

pkg/gitreceive/storage/endpoint.go

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,15 @@ type Endpoint struct {
4141
Secure bool
4242
}
4343

44+
// FullURL returns the full URL string of an endpoint, including its URL scheme, based on e.Secure
45+
func (e *Endpoint) FullURL() string {
46+
if e.Secure {
47+
return fmt.Sprintf("https://%s", e.URLStr)
48+
} else {
49+
return fmt.Sprintf("http://%s", e.URLStr)
50+
}
51+
}
52+
4453
func getEndpoint(env sys.Env) (*Endpoint, error) {
4554
mHost := env.Get(minioHostEnvVar)
4655
mPort := env.Get(minioPortEnvVar)

0 commit comments

Comments
 (0)