trimoq commented on issue #1050: Segfault when Scheme not defined
URL: 
https://github.com/apache/incubator-openwhisk-wskdeploy/issues/1050#issuecomment-482066142
 
 
   Ok, according to the [go 
docs](https://golang.org/src/net/url/url.go?s=13181:13220#L469):
   
   > Trying to parse a hostname and path without a scheme is invalid but may 
not necessarily return an error, due to parsing ambiguities. 
   
   If the code in the [go 
client](https://github.com/apache/incubator-openwhisk-client-go/blob/47ad3426a4e3632fd17d859303f4074ae7b959ff/whisk/wskprops.go#L72)
 is modified to the following, a missing schema is not causing a segfault 
anymore.
   
   ```go
   // was:    if len(url.Scheme) == 0 || len(url.Host) == 0 { 
   if url==nil || len(url.Scheme) == 0 || len(url.Host) == 0 { 
     urlBase = fmt.Sprintf("https://%s/api";, host)
     url, err = url.Parse(urlBase)
   }
   ```
   Does this has to be fixed or must the user set the scheme in the first place?
   

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to