Skip to content

Commit

Permalink
Updated RPC capcbilities
Browse files Browse the repository at this point in the history
  • Loading branch information
lonelycode committed Mar 18, 2016
1 parent e0117bc commit 35978a6
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
10 changes: 10 additions & 0 deletions api_definition_manager.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,6 +524,16 @@ func (a *APIDefinitionLoader) LoadDefinitionsFromRPC(orgId string) *[]*APISpec {
thisAppConfig.DecodeFromDB()
thisAppConfig.RawData = StringDefs[i] // Lets keep a copy for plugable modules

if config.SlaveOptions.BindToSlugsInsteadOfListenPaths {
newListenPath := "/" + thisAppConfig.Slug + "/"
log.Warning("Binding to ",
newListenPath,
" instead of ",
thisAppConfig.Proxy.ListenPath)

thisAppConfig.Proxy.ListenPath = newListenPath
}

newAppSpec := a.MakeSpec(thisAppConfig)
APISpecs = append(APISpecs, &newAppSpec)
}
Expand Down
11 changes: 6 additions & 5 deletions config.go
Original file line number Diff line number Diff line change
Expand Up @@ -75,11 +75,12 @@ type Config struct {
OauthRefreshExpire int64 `json:"oauth_refresh_token_expire"`
OauthTokenExpire int32 `json:"oauth_token_expire"`
SlaveOptions struct {
UseRPC bool `json:"use_rpc"`
ConnectionString string `json:"connection_string"`
RPCKey string `json:"rpc_key"`
APIKey string `json:"api_key"`
EnableRPCCache bool `json:"enable_rpc_cache"`
UseRPC bool `json:"use_rpc"`
ConnectionString string `json:"connection_string"`
RPCKey string `json:"rpc_key"`
APIKey string `json:"api_key"`
EnableRPCCache bool `json:"enable_rpc_cache"`
BindToSlugsInsteadOfListenPaths bool `json:"bind_to_slugs"`
} `json:"slave_options"`
DisableVirtualPathBlobs bool `json:"disable_virtual_path_blobs"`
LocalSessionCache struct {
Expand Down
8 changes: 4 additions & 4 deletions tyk_reverse_proxy_clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -244,19 +244,19 @@ func singleJoiningSlash(a, b string) string {

switch {
case aslash && bslash:
log.Info(a + b)
log.Debug(a + b)
return a + b[1:]
case !aslash && !bslash:
if len(b) > 0 {
log.Info(a + b)
log.Debug(a + b)
return a + "/" + b
} else {
log.Info(a + b)
log.Debug(a + b)
return a
}

}
log.Info(a + b)
log.Debug(a + b)
return a + b
}

Expand Down

0 comments on commit 35978a6

Please sign in to comment.