Skip to content

Commit

Permalink
fix: add telemetry slug for additional file exts (#21522)
Browse files Browse the repository at this point in the history
* fix: add telemetry slug for more exts

* chore: update CHANGELOG
  • Loading branch information
williamhbaker authored May 20, 2021
1 parent ce48262 commit fee3c46
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 0 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
1. [21477](https://github.com/influxdata/influxdb/pull/21477): Print error instead of panicking when `influx restore` fails to find backup manifests.
1. [21481](https://github.com/influxdata/influxdb/pull/21481): Set last-modified time of empty shard directory to the directory's mod time instead of Unix epoch.
1. [21486](https://github.com/influxdata/influxdb/pull/21486): chore: remove erroneous dependency on istio
1. [21522](https://github.com/influxdata/influxdb/pull/21522): Replace telemetry file name with slug for `ttf`, `woff`, and `eot` files.

## v2.0.6 [2021-04-29]

Expand Down
3 changes: 3 additions & 0 deletions kit/transport/http/middleware.go
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,9 @@ func normalizeAssetFile(f string) string {
".wasm",
".map",
".LICENSE",
".ttf",
".woff",
".eot",
}

for _, ext := range exts {
Expand Down
15 changes: 15 additions & 0 deletions kit/transport/http/middleware_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,21 @@ func Test_normalizePath(t *testing.T) {
path: "/api/v2/backup/shards/1005/extra",
expected: path.Join("/api/v2/backup/shards/", shardSlug, "extra"),
},
{
name: "11",
path: "/35bb8d560d.ttf",
expected: "/" + fileSlug + ".ttf",
},
{
name: "12",
path: "/35bb8d560d.woff",
expected: "/" + fileSlug + ".woff",
},
{
name: "13",
path: "/35bb8d560d.eot",
expected: "/" + fileSlug + ".eot",
},
}

for _, tt := range tests {
Expand Down

0 comments on commit fee3c46

Please sign in to comment.