Skip to content

Commit

Permalink
Merge pull request #33 from sylabs/fix-getoutput
Browse files Browse the repository at this point in the history
Resolve issue with base URL containing path element(s)
  • Loading branch information
tri-adam authored Apr 25, 2020
2 parents b7fdf9f + 4ddde45 commit e6c61fb
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions client/output.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,16 +26,15 @@ type OutputReader interface {
// GetOutput reads the build output log for the provided buildID - streaming to
// OutputReader. The context controls the lifetime of the request.
func (c *Client) GetOutput(ctx context.Context, buildID string, or OutputReader) error {
u := c.BaseURL.ResolveReference(&url.URL{
Path: "v1/build-ws/" + buildID,
})

wsScheme := "ws"
if c.BaseURL.Scheme == "https" {
wsScheme = "wss"
}
u := c.BaseURL.ResolveReference(&url.URL{
Scheme: wsScheme,
Host: c.BaseURL.Host,
Path: "/v1/build-ws/" + buildID,
RawQuery: "",
})
u.Scheme = wsScheme

h := http.Header{}
c.setRequestHeaders(h)
Expand Down

0 comments on commit e6c61fb

Please sign in to comment.