Skip to content

Commit 7a81a64

Browse files
committed
Merge remote-tracking branch 'origin/master' into fix/issue-1046
2 parents da402f3 + 6a45fa8 commit 7a81a64

9 files changed

Lines changed: 218 additions & 322 deletions

File tree

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,11 @@
66
* Add startup migration for legacy plaintext secrets when a secrets master key is configured.
77
* Add `chronoctl` commands for master-key generation, rewrap, and disable workflows.
88
* Secrets encryption is supported only for BoltDB-backed deployments.
9+
## v1.11.4 [2026-06-16]
10+
11+
### Bug Fixes
12+
13+
1. [#6227](https://github.com/influxdata/chronograf/pull/6227): Respect base path in minified UI HTML.
914

1015
## v1.11.3 [2026-05-27]
1116

go.mod

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ require (
2222
go.etcd.io/bbolt v1.3.7
2323
go.etcd.io/etcd/client/v3 v3.5.0-alpha.0
2424
go.etcd.io/etcd/server/v3 v3.5.0-alpha.0
25-
golang.org/x/net v0.51.0
25+
golang.org/x/net v0.55.0
2626
golang.org/x/oauth2 v0.34.0
2727
google.golang.org/api v0.230.0
2828
google.golang.org/protobuf v1.36.10
@@ -105,15 +105,15 @@ require (
105105
go.uber.org/atomic v1.11.0 // indirect
106106
go.uber.org/multierr v1.10.0 // indirect
107107
go.uber.org/zap v1.27.0 // indirect
108-
golang.org/x/crypto v0.48.0 // indirect
108+
golang.org/x/crypto v0.52.0 // indirect
109109
golang.org/x/exp v0.0.0-20250408133849-7e4ce0ab07d0 // indirect
110-
golang.org/x/mod v0.32.0 // indirect
111-
golang.org/x/sync v0.19.0 // indirect
112-
golang.org/x/sys v0.41.0 // indirect
113-
golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 // indirect
114-
golang.org/x/text v0.34.0 // indirect
110+
golang.org/x/mod v0.35.0 // indirect
111+
golang.org/x/sync v0.20.0 // indirect
112+
golang.org/x/sys v0.45.0 // indirect
113+
golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa // indirect
114+
golang.org/x/text v0.37.0 // indirect
115115
golang.org/x/time v0.11.0 // indirect
116-
golang.org/x/tools v0.41.0 // indirect
116+
golang.org/x/tools v0.44.0 // indirect
117117
golang.org/x/xerrors v0.0.0-20240903120638-7835f813f4da // indirect
118118
google.golang.org/genproto v0.0.0-20250303144028-a0af3efb3deb // indirect
119119
google.golang.org/genproto/googleapis/api v0.0.0-20251202230838-ff82c1b0f217 // indirect

go.sum

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -655,8 +655,8 @@ golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8U
655655
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
656656
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
657657
golang.org/x/crypto v0.0.0-20201002170205-7f63de1d35b0/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
658-
golang.org/x/crypto v0.48.0 h1:/VRzVqiRSggnhY7gNRxPauEQ5Drw9haKdM0jqfcCFts=
659-
golang.org/x/crypto v0.48.0/go.mod h1:r0kV5h3qnFPlQnBSrULhlsRfryS2pmewsg+XfMgkVos=
658+
golang.org/x/crypto v0.52.0 h1:RMs7fP2rXdep0CftQlK8Uf+kibLm7qkCcradZWYz988=
659+
golang.org/x/crypto v0.52.0/go.mod h1:1QgfPxDqh0T2M/elOJtp9RvuR95kVjir0e6/BvEmGbc=
660660
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
661661
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
662662
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
@@ -683,8 +683,8 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
683683
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
684684
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
685685
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
686-
golang.org/x/mod v0.32.0 h1:9F4d3PHLljb6x//jOyokMv3eX+YDeepZSEo3mFJy93c=
687-
golang.org/x/mod v0.32.0/go.mod h1:SgipZ/3h2Ci89DlEtEXWUk/HteuRin+HHhN+WbNhguU=
686+
golang.org/x/mod v0.35.0 h1:Ww1D637e6Pg+Zb2KrWfHQUnH2dQRLBQyAtpr/haaJeM=
687+
golang.org/x/mod v0.35.0/go.mod h1:+GwiRhIInF8wPm+4AoT6L0FA1QWAad3OMdTRx4tFYlU=
688688
golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
689689
golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
690690
golang.org/x/net v0.0.0-20181023162649-9b4f9f5ad519/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
@@ -706,8 +706,8 @@ golang.org/x/net v0.0.0-20200421231249-e086a090c8fd/go.mod h1:qpuaurCH72eLCgpAm/
706706
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
707707
golang.org/x/net v0.0.0-20201021035429-f5854403a974/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
708708
golang.org/x/net v0.0.0-20201202161906-c7110b5ffcbb/go.mod h1:sp8m0HH+o8qH0wwXwYZr8TS3Oi6o0r6Gce1SSxlDquU=
709-
golang.org/x/net v0.51.0 h1:94R/GTO7mt3/4wIKpcR5gkGmRLOuE/2hNGeWq/GBIFo=
710-
golang.org/x/net v0.51.0/go.mod h1:aamm+2QF5ogm02fjy5Bb7CQ0WMt1/WVM7FtyaTLlA9Y=
709+
golang.org/x/net v0.55.0 h1:bcvxaJn3e1U6InsFWt1JUq1aSjnRxLzT2rtD2KfkDF8=
710+
golang.org/x/net v0.55.0/go.mod h1:L5U2KuzuOe1lY7Z+aWVIKK6qEeJXnXV9yzGA+WCHJww=
711711
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
712712
golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
713713
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
@@ -722,8 +722,8 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
722722
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
723723
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
724724
golang.org/x/sync v0.0.0-20201020160332-67f06af15bc9/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
725-
golang.org/x/sync v0.19.0 h1:vV+1eWNmZ5geRlYjzm2adRgW2/mcpevXNg50YZtPCE4=
726-
golang.org/x/sync v0.19.0/go.mod h1:9KTHXmSnoGruLpwFjVSX0lNNA75CykiMECbovNTZqGI=
725+
golang.org/x/sync v0.20.0 h1:e0PTpb7pjO8GAtTs2dQ6jYa5BWYlMuX047Dco/pItO4=
726+
golang.org/x/sync v0.20.0/go.mod h1:9xrNwdLfx4jkKbNva9FpL6vEN7evnE43NNNJQ2LF3+0=
727727
golang.org/x/sys v0.0.0-20180823144017-11551d06cbcc/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
728728
golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
729729
golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
@@ -748,18 +748,18 @@ golang.org/x/sys v0.0.0-20200420163511-1957bb5e6d1f/go.mod h1:h1NjWce9XRLGQEsW7w
748748
golang.org/x/sys v0.0.0-20200930185726-fdedc70b468f/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
749749
golang.org/x/sys v0.0.0-20201009025420-dfb3f7c4e634/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
750750
golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
751-
golang.org/x/sys v0.41.0 h1:Ivj+2Cp/ylzLiEU89QhWblYnOE9zerudt9Ftecq2C6k=
752-
golang.org/x/sys v0.41.0/go.mod h1:OgkHotnGiDImocRcuBABYBEXf8A9a87e/uXjp9XT3ks=
753-
golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2 h1:O1cMQHRfwNpDfDJerqRoE2oD+AFlyid87D40L/OkkJo=
754-
golang.org/x/telemetry v0.0.0-20260109210033-bd525da824e2/go.mod h1:b7fPSJ0pKZ3ccUh8gnTONJxhn3c/PS6tyzQvyqw4iA8=
755-
golang.org/x/term v0.40.0 h1:36e4zGLqU4yhjlmxEaagx2KuYbJq3EwY8K943ZsHcvg=
756-
golang.org/x/term v0.40.0/go.mod h1:w2P8uVp06p2iyKKuvXIm7N/y0UCRt3UfJTfZ7oOpglM=
751+
golang.org/x/sys v0.45.0 h1:dO4czNzziLiiXplLQgBCEpCvXQ3dnkn0SdaZSYdQ+FY=
752+
golang.org/x/sys v0.45.0/go.mod h1:4GL1E5IUh+htKOUEOaiffhrAeqysfVGipDYzABqnCmw=
753+
golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa h1:efT73AJZfAAUV7SOip6pWGkwJDzIGiKBZGVzHYa+ve4=
754+
golang.org/x/telemetry v0.0.0-20260409153401-be6f6cb8b1fa/go.mod h1:kHjTxDEnAu6/Nl9lDkzjWpR+bmKfxeiRuSDlsMb70gE=
755+
golang.org/x/term v0.43.0 h1:S4RLU2sB31O/NCl+zFN9Aru9A/Cq2aqKpTZJ6B+DwT4=
756+
golang.org/x/term v0.43.0/go.mod h1:lrhlHNdQJHO+1qVYiHfFKVuVioJIheAc3fBSMFYEIsk=
757757
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
758758
golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
759759
golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
760760
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
761-
golang.org/x/text v0.34.0 h1:oL/Qq0Kdaqxa1KbNeMKwQq0reLCCaFtqu2eNuSeNHbk=
762-
golang.org/x/text v0.34.0/go.mod h1:homfLqTYRFyVYemLBFl5GgL/DWEiH5wcsQ5gSh1yziA=
761+
golang.org/x/text v0.37.0 h1:Cqjiwd9eSg8e0QAkyCaQTNHFIIzWtidPahFWR83rTrc=
762+
golang.org/x/text v0.37.0/go.mod h1:a5sjxXGs9hsn/AJVwuElvCAo9v8QYLzvavO5z2PiM38=
763763
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
764764
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
765765
golang.org/x/time v0.0.0-20200630173020-3af7569d3a1e/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
@@ -792,8 +792,8 @@ golang.org/x/tools v0.0.0-20200207183749-b753a1ba74fa/go.mod h1:TB2adYChydJhpapK
792792
golang.org/x/tools v0.0.0-20200619180055-7c47624df98f/go.mod h1:EkVYQZoAsY45+roYkvgYkIh4xh/qjgUK9TdY2XT94GE=
793793
golang.org/x/tools v0.0.0-20201014170642-d1624618ad65/go.mod h1:z6u4i615ZeAfBE4XtMziQW1fSVJXACjjbWkB/mvPzlU=
794794
golang.org/x/tools v0.0.0-20210106214847-113979e3529a/go.mod h1:emZCQorbCU4vsT4fOWvOPXz4eW1wZW4PmDk9uLelYpA=
795-
golang.org/x/tools v0.41.0 h1:a9b8iMweWG+S0OBnlU36rzLp20z1Rp10w+IY2czHTQc=
796-
golang.org/x/tools v0.41.0/go.mod h1:XSY6eDqxVNiYgezAVqqCeihT4j1U2CCsqvH3WhQpnlg=
795+
golang.org/x/tools v0.44.0 h1:UP4ajHPIcuMjT1GqzDWRlalUEoY+uzoZKnhOjbIPD2c=
796+
golang.org/x/tools v0.44.0/go.mod h1:KA0AfVErSdxRZIsOVipbv3rQhVXTnlU6UhKxHd1seDI=
797797
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
798798
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
799799
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"@parcel/transformer-sass": "^2.16.4",
3232
"assert": "^2.0.0",
3333
"events": "^3.3.0",
34-
"http-proxy-middleware": "^2.0.9",
34+
"http-proxy-middleware": "^2.0.10",
3535
"process": "^0.11.10",
3636
"querystring-es3": "^0.2.1",
3737
"url": "^0.11.4",

server/swagger.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"info": {
44
"title": "Chronograf",
55
"description": "API endpoints for Chronograf",
6-
"version": "1.11.3"
6+
"version": "1.11.4"
77
},
88
"schemes": ["http"],
99
"basePath": "/chronograf/v1",

server/url_prefixer.go

Lines changed: 59 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -104,47 +104,77 @@ func (up *URLPrefixer) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
104104

105105
// setup a buffer which is the max length of our target attrs
106106
b := make([]byte, up.maxlen(up.Attrs...))
107-
io.ReadFull(nextRead, b) // prime the buffer with the start of the input
108-
buf := bytes.NewBuffer(b)
107+
n, _ := io.ReadFull(nextRead, b) // prime the buffer with the start of the input
108+
buf := bytes.NewBuffer(b[:n])
109109

110110
// Read next handler's response byte by byte
111111
src := bufio.NewScanner(nextRead)
112112
src.Split(bufio.ScanBytes)
113113
for {
114114
window := buf.Bytes()
115115

116+
if len(window) == 0 {
117+
flusher.Flush()
118+
break
119+
}
120+
116121
// advance a byte if window is not a src attr
117-
if matchlen, match := up.match(window, up.Attrs...); matchlen == 0 {
122+
matchlen, match := up.match(window, up.Attrs...)
123+
if matchlen == 0 {
124+
rw.Write(buf.Next(1))
125+
writtenCount++
126+
118127
if src.Scan() {
119-
// shift the next byte into buf
120-
rw.Write(buf.Next(1))
121-
writtenCount++
122128
buf.Write(src.Bytes())
129+
} else if err := src.Err(); err != nil {
130+
up.Logger.
131+
WithField("component", "prefixer").
132+
Error("Error encountered while scanning: err:", err)
133+
}
123134

124-
if writtenCount >= ChunkSize {
125-
flusher.Flush()
126-
writtenCount = 0
127-
}
128-
} else {
129-
if err := src.Err(); err != nil {
130-
up.Logger.
131-
WithField("component", "prefixer").
132-
Error("Error encountered while scanning: err:", err)
133-
}
134-
rw.Write(window)
135+
if writtenCount >= ChunkSize {
135136
flusher.Flush()
136-
break
137+
writtenCount = 0
137138
}
139+
138140
continue
139-
} else {
140-
buf.Next(matchlen) // advance to the relative URL
141-
for i := 0; i < matchlen; i++ {
142-
src.Scan()
143-
buf.Write(src.Bytes())
141+
}
142+
143+
buf.Next(matchlen) // advance to the relative URL
144+
for i := 0; i < matchlen; i++ {
145+
src.Scan()
146+
buf.Write(src.Bytes())
147+
}
148+
if bytes.Equal(match, []byte(`src=/`)) {
149+
if bytes.HasPrefix(buf.Bytes(), []byte(`/`)) {
150+
rw.Write(match)
151+
continue
152+
}
153+
rw.Write([]byte(`src=`))
154+
io.WriteString(rw, up.Prefix)
155+
continue
156+
}
157+
if bytes.Equal(match, []byte(`href=/`)) {
158+
if bytes.HasPrefix(buf.Bytes(), []byte(`/`)) {
159+
rw.Write(match)
160+
continue
144161
}
145-
rw.Write(match) // add the src attr to the output
146-
io.WriteString(rw, up.Prefix) // write the prefix
162+
rw.Write([]byte(`href=`))
163+
io.WriteString(rw, up.Prefix)
164+
continue
165+
}
166+
if bytes.Equal(match, []byte(`data-basepath`)) {
167+
if len(buf.Bytes()) > 0 && bytes.ContainsAny(buf.Bytes()[:1], "> \t\r\n") {
168+
rw.Write([]byte(`data-basepath="`))
169+
io.WriteString(rw, up.Prefix)
170+
rw.Write([]byte(`"`))
171+
continue
172+
}
173+
rw.Write(match)
174+
continue
147175
}
176+
rw.Write(match) // add the src attr to the output
177+
io.WriteString(rw, up.Prefix) // write the prefix
148178
}
149179
}
150180

@@ -154,7 +184,7 @@ func (up *URLPrefixer) ServeHTTP(rw http.ResponseWriter, r *http.Request) {
154184
// targets. The matching []byte is also returned as the second return parameter
155185
func (up *URLPrefixer) match(subject []byte, targets ...[]byte) (int, []byte) {
156186
for _, target := range targets {
157-
if bytes.Equal(subject[:len(target)], target) {
187+
if len(subject) >= len(target) && bytes.Equal(subject[:len(target)], target) {
158188
return len(target), target
159189
}
160190
}
@@ -186,7 +216,10 @@ func NewDefaultURLPrefixer(prefix string, next http.Handler, lg chronograf.Logge
186216
[]byte(`src="`),
187217
[]byte(`href="`),
188218
[]byte(`url(`),
219+
[]byte(`src=/`),
220+
[]byte(`href=/`),
189221
[]byte(`data-basepath="`), // for forwarding basepath to frontend
222+
[]byte(`data-basepath`),
190223
},
191224
}
192225
}

server/url_prefixer_test.go

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,3 +210,54 @@ func Test_Server_Prefixer_IgnoreJsAndSvg(t *testing.T) {
210210
}
211211
}
212212
}
213+
214+
func Test_Server_Prefixer_RewritesMinifiedHTML(t *testing.T) {
215+
t.Parallel()
216+
217+
tests := []struct {
218+
name string
219+
subject string
220+
expected string
221+
}{
222+
{"Unquoted href", `<link rel=stylesheet href=/ui.css>`, `<link rel=stylesheet href=/chronograf/ui.css>`},
223+
{"Unquoted src", `<script src=/ui.js></script>`, `<script src=/chronograf/ui.js></script>`},
224+
{"Empty data-basepath", `<div id=react-root data-basepath></div>`, `<div id=react-root data-basepath="/chronograf/"></div>`},
225+
{"Quoted data-basepath", `<div id=react-root data-basepath=""></div>`, `<div id=react-root data-basepath="/chronograf/"></div>`},
226+
{
227+
"Minified index HTML",
228+
`<link rel=stylesheet href=/ui.f8bbc9c4.css><link rel="icon shortcut" href=/favicon.70d63073.ico><div id=react-root data-basepath></div><script type=module src=/ui.eb3e79e6.js></script>`,
229+
`<link rel=stylesheet href=/chronograf/ui.f8bbc9c4.css><link rel="icon shortcut" href=/chronograf/favicon.70d63073.ico><div id=react-root data-basepath="/chronograf/"></div><script type=module src=/chronograf/ui.eb3e79e6.js></script>`,
230+
},
231+
}
232+
233+
for _, test := range tests {
234+
backend := http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
235+
fmt.Fprint(w, test.subject)
236+
})
237+
238+
pfx := server.NewDefaultURLPrefixer("/chronograf/", backend, nil)
239+
240+
ts := httptest.NewServer(pfx)
241+
defer ts.Close()
242+
243+
res, err := http.Get(ts.URL)
244+
if err != nil {
245+
t.Fatal("Unexpected error fetching from prefixer: err:", err)
246+
}
247+
248+
actual, err := ioutil.ReadAll(res.Body)
249+
if err != nil {
250+
t.Fatal("Unable to read prefixed body: err:", err)
251+
}
252+
253+
if string(actual) != test.expected {
254+
t.Error(
255+
test.name,
256+
":\n Unsuccessful prefixing.\n\tWant:",
257+
fmt.Sprintf("%+q", test.expected),
258+
"\n\tGot: ",
259+
fmt.Sprintf("%+q", string(actual)),
260+
)
261+
}
262+
}
263+
}

ui/package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "chronograf-ui",
3-
"version": "1.11.3",
3+
"version": "1.11.4",
44
"private": true,
55
"license": "AGPL-3.0",
66
"description": "",
@@ -44,7 +44,7 @@
4444
},
4545
"author": "",
4646
"devDependencies": {
47-
"@babel/core": "^7.28.5",
47+
"@babel/core": "^7.29.6",
4848
"@babel/eslint-parser": "^7.28.5",
4949
"@babel/eslint-plugin": "^7.27.1",
5050
"@babel/plugin-proposal-class-properties": "^7.1.0",

0 commit comments

Comments
 (0)