Loading go-apps/meep-app-enablement/server/service-mgmt/service-mgmt.go +21 −2 Original line number Diff line number Diff line Loading @@ -383,14 +383,33 @@ func appServicesPOST(w http.ResponseWriter, r *http.Request) { } deleteCapifMapping(sInfo.SerInstanceId) } // Use transportInfo.endpoint.uris[0] as the service endpoint for CAPIF. // Fall back to the hostUrl-based URI if no transport URI is available. host := hostUrl.Hostname() port := 443 if hostUrl.Port() != "" { uri := basePath + "applications/" + appId + "/services/" + sInfo.SerInstanceId if sInfo.TransportInfo != nil && sInfo.TransportInfo.Endpoint != nil && len(sInfo.TransportInfo.Endpoint.EndPointInfoUris.Uris) > 0 { transportURI := sInfo.TransportInfo.Endpoint.EndPointInfoUris.Uris[0] if parsed, err := url.Parse(transportURI); err == nil { host = parsed.Hostname() uri = parsed.Path if parsed.Port() != "" { if p, err := strconv.Atoi(parsed.Port()); err == nil { port = p } } else if parsed.Scheme == "https" { port = 443 } else { port = 80 } } } else if hostUrl.Port() != "" { if p, err := strconv.Atoi(hostUrl.Port()); err == nil { port = p } } uri := basePath + "applications/" + appId + "/services/" + sInfo.SerInstanceId apiId, err := capifClient.PublishServiceAPI( sInfo.SerName+"-"+sandboxName, sInfo.Version, Loading Loading
go-apps/meep-app-enablement/server/service-mgmt/service-mgmt.go +21 −2 Original line number Diff line number Diff line Loading @@ -383,14 +383,33 @@ func appServicesPOST(w http.ResponseWriter, r *http.Request) { } deleteCapifMapping(sInfo.SerInstanceId) } // Use transportInfo.endpoint.uris[0] as the service endpoint for CAPIF. // Fall back to the hostUrl-based URI if no transport URI is available. host := hostUrl.Hostname() port := 443 if hostUrl.Port() != "" { uri := basePath + "applications/" + appId + "/services/" + sInfo.SerInstanceId if sInfo.TransportInfo != nil && sInfo.TransportInfo.Endpoint != nil && len(sInfo.TransportInfo.Endpoint.EndPointInfoUris.Uris) > 0 { transportURI := sInfo.TransportInfo.Endpoint.EndPointInfoUris.Uris[0] if parsed, err := url.Parse(transportURI); err == nil { host = parsed.Hostname() uri = parsed.Path if parsed.Port() != "" { if p, err := strconv.Atoi(parsed.Port()); err == nil { port = p } } else if parsed.Scheme == "https" { port = 443 } else { port = 80 } } } else if hostUrl.Port() != "" { if p, err := strconv.Atoi(hostUrl.Port()); err == nil { port = p } } uri := basePath + "applications/" + appId + "/services/" + sInfo.SerInstanceId apiId, err := capifClient.PublishServiceAPI( sInfo.SerName+"-"+sandboxName, sInfo.Version, Loading