initPrefix uses the user provided server URL to define the URL prefix to the blobserver root. If the server URL has a path component then it is directly used, otherwise the blobRoot from the discovery is used as the path.
()
| 973 | // component then it is directly used, otherwise the blobRoot |
| 974 | // from the discovery is used as the path. |
| 975 | func (c *Client) initPrefix() error { |
| 976 | c.isSharePrefix = false |
| 977 | root := c.discoRoot() |
| 978 | u, err := url.Parse(root) |
| 979 | if err != nil { |
| 980 | return err |
| 981 | } |
| 982 | if len(u.Path) > 1 { |
| 983 | c.prefixv = strings.TrimRight(root, "/") |
| 984 | return nil |
| 985 | } |
| 986 | return c.condDiscovery() |
| 987 | } |
| 988 | |
| 989 | func (c *Client) condDiscovery() error { |
| 990 | if c.sto != nil { |
nothing calls this directly
no test coverage detected