Skip to content

Commit

Permalink
More review fixes. (google#313)
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin2112 authored Aug 7, 2018
1 parent 982edfa commit b86cd3e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
16 changes: 8 additions & 8 deletions trillian/ctfe/configpb/config.pb.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion trillian/ctfe/configpb/config.proto
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ message LogConfig {
// which is common for both types.
int64 log_id = 1;
// prefix is the name of the log. It will come after the global or
// custom handler prefix. For example if the handler prefix is "/logs"
// override handler prefix. For example if the handler prefix is "/logs"
// and prefix is "vogon" the get-sth handler for this log will be
// available at "/logs/vogon/ct/v1/get-sth". The prefix cannot be empty
// and must not include "/" path separator characters.
Expand Down
6 changes: 3 additions & 3 deletions trillian/ctfe/ct_server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ func main() {
// Register handlers for all the configured logs using the correct RPC
// client.
for _, c := range cfg.LogConfigs.Config {
if err := setupAndRegister(ctx, clientMap[c.LogBackendName], *rpcDeadline, c, corsMux); err != nil {
if err := setupAndRegister(ctx, clientMap[c.LogBackendName], *rpcDeadline, c, corsMux, *handlerPrefix); err != nil {
glog.Exitf("Failed to set up log instance for %+v: %v", cfg, err)
}
}
Expand Down Expand Up @@ -270,7 +270,7 @@ func awaitSignal(doneFn func()) {
doneFn()
}

func setupAndRegister(ctx context.Context, client trillian.TrillianLogClient, deadline time.Duration, cfg *configpb.LogConfig, mux *http.ServeMux) error {
func setupAndRegister(ctx context.Context, client trillian.TrillianLogClient, deadline time.Duration, cfg *configpb.LogConfig, mux *http.ServeMux, globalHandlerPrefix string) error {
if cfg.IsMirror {
return errors.New("mirrors are not supported")
}
Expand All @@ -297,7 +297,7 @@ func setupAndRegister(ctx context.Context, client trillian.TrillianLogClient, de
// have an existing URL path that differs from the global one. For example
// if all new logs are served on "/logs/log/..." and a previously existing
// log is at "/log/..." this is now supported.
lhp := *handlerPrefix
lhp := globalHandlerPrefix
if len(opts.Config.OverrideHandlerPrefix) > 0 {
glog.Infof("Log with prefix: %s is using a custom HandlerPrefix: %s", opts.Config.Prefix, opts.Config.OverrideHandlerPrefix)
lhp = "/" + strings.Trim(opts.Config.OverrideHandlerPrefix, "/")
Expand Down

0 comments on commit b86cd3e

Please sign in to comment.