outpost/proxy: fix string substitution for internal

Signed-off-by: Jens Langhammer <jens.langhammer@beryju.org>
This commit is contained in:
Jens Langhammer 2021-08-08 22:24:10 +02:00
parent 837fa23af0
commit 03958d170b
1 changed files with 6 additions and 3 deletions

View File

@ -36,9 +36,12 @@ func intToPointer(i int) *int {
} }
func (pb *providerBundle) replaceLocal(url string) string { func (pb *providerBundle) replaceLocal(url string) string {
if strings.Contains(url, "localhost:8000") {
f := strings.ReplaceAll(url, "localhost:8000", pb.s.ak.Client.GetConfig().Host) f := strings.ReplaceAll(url, "localhost:8000", pb.s.ak.Client.GetConfig().Host)
f = strings.ReplaceAll(f, "http", pb.s.ak.Client.GetConfig().Scheme) f = strings.ReplaceAll(f, "http", pb.s.ak.Client.GetConfig().Scheme)
return f return f
}
return url
} }
func (pb *providerBundle) prepareOpts(provider api.ProxyOutpostConfig) *options.Options { func (pb *providerBundle) prepareOpts(provider api.ProxyOutpostConfig) *options.Options {