AbsPath should be compatible with proxy-prefixes:

- replace Config.Prefix with .Host and .APIPath
- Request .path promoted to .pathPrefix, .baseURL holds required prefix
This commit is contained in:
James DeFelice
2016-01-06 23:59:54 +00:00
parent 9724447456
commit 75f487f7bf
17 changed files with 158 additions and 119 deletions

View File

@@ -134,14 +134,10 @@ func TestSetWithPathPrefixIntoExistingStruct(t *testing.T) {
if err != nil {
t.Fatalf("unexpected error: %v", err)
}
expectedHost := "http://cow.org:8080"
expectedHost := "http://cow.org:8080/foo/baz"
if expectedHost != dcc.Host {
t.Fatalf("expected client.Config.Host = %q instead of %q", expectedHost, dcc.Host)
}
expectedPrefix := "/foo/baz"
if expectedPrefix != dcc.Prefix {
t.Fatalf("expected client.Config.Prefix = %q instead of %q", expectedPrefix, dcc.Prefix)
}
}
func TestUnsetStruct(t *testing.T) {