Skip to content

Commit

Permalink
Encode spaces in dataset names for the URL (#73)
Browse files Browse the repository at this point in the history
The io.honeycomb.com URLs for datasets with spaces in the name use a `-` (dash) for encoding that space. This change fixes the `buildURL` function to also use dashes for spaces, instead of exposing the space character.
  • Loading branch information
DavidS authored Dec 17, 2020
1 parent 23401fd commit 440dbe0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion common.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,7 +177,7 @@ func buildURL(cfg *libhoney.Config, traceID string, ts int64) (string, error) {
if err != nil {
return "", fmt.Errorf("unable to infer UI host: %s", uiHost)
}
u.Path = path.Join(teamName, "datasets", cfg.Dataset, "trace")
u.Path = path.Join(teamName, "datasets", strings.Replace(cfg.Dataset, " ", "-", -1), "trace")
endTime := time.Now().Add(10 * time.Minute).Unix()
return fmt.Sprintf(
"%s?trace_id=%s&trace_start_ts=%d&trace_end_ts=%d",
Expand Down

0 comments on commit 440dbe0

Please sign in to comment.