Skip to content

Commit e6c61fb

Browse files
authoredApr 25, 2020
Merge pull request #33 from sylabs/fix-getoutput
Resolve issue with base URL containing path element(s)
2 parents b7fdf9f + 4ddde45 commit e6c61fb

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed
 

‎client/output.go

+5-6
Original file line numberDiff line numberDiff line change
@@ -26,16 +26,15 @@ type OutputReader interface {
2626
// GetOutput reads the build output log for the provided buildID - streaming to
2727
// OutputReader. The context controls the lifetime of the request.
2828
func (c *Client) GetOutput(ctx context.Context, buildID string, or OutputReader) error {
29+
u := c.BaseURL.ResolveReference(&url.URL{
30+
Path: "v1/build-ws/" + buildID,
31+
})
32+
2933
wsScheme := "ws"
3034
if c.BaseURL.Scheme == "https" {
3135
wsScheme = "wss"
3236
}
33-
u := c.BaseURL.ResolveReference(&url.URL{
34-
Scheme: wsScheme,
35-
Host: c.BaseURL.Host,
36-
Path: "/v1/build-ws/" + buildID,
37-
RawQuery: "",
38-
})
37+
u.Scheme = wsScheme
3938

4039
h := http.Header{}
4140
c.setRequestHeaders(h)

0 commit comments

Comments
 (0)