File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -152,6 +152,10 @@ func (g *global) URL() *url.URL {
152152 return g .url
153153}
154154
155+ func (g * global ) SetURL (url * url.URL ) {
156+ g .url = url
157+ }
158+
155159func (g * global ) IsTerm () int {
156160 return TerminalWidth ()
157161}
Original file line number Diff line number Diff line change @@ -3,6 +3,7 @@ package cmd
33import (
44 "crypto/tls"
55 "fmt"
6+ "net/url"
67 "os"
78
89 // Packages
@@ -99,9 +100,14 @@ func (s *RunServer) Run(ctx server.Cmd) error {
99100 if err := srv .Listen (); err != nil {
100101 return err
101102 }
102- if url := srv .URL (); url != nil {
103- url .Path = types .NormalisePath (ctx .HTTPPrefix ())
104- ctx .(* global ).url = url
103+ if u := srv .URL (); u != nil {
104+ u .Path = types .NormalisePath (ctx .HTTPPrefix ())
105+ type urlSetter interface {
106+ SetURL (* url.URL )
107+ }
108+ if ctx , ok := ctx .(urlSetter ); ok {
109+ ctx .SetURL (u )
110+ }
105111 }
106112
107113 // Build middleware chain: OTel HTTP middleware which emits traces, logs and metrics
You can’t perform that action at this time.
0 commit comments