Skip to content

Commit 5df91b2

Browse files
committed
fix: BASE_HREF ignore (argoproj#6926)
Signed-off-by: Saravanan Balasubramanian <[email protected]>
1 parent d04aabf commit 5df91b2

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

cmd/argo/commands/server.go

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,8 +182,13 @@ See %s`, help.ArgoServer),
182182
},
183183
}
184184

185+
defaultBaseHRef := os.Getenv("BASE_HREF")
186+
if defaultBaseHRef == "" {
187+
defaultBaseHRef = "/"
188+
}
189+
185190
command.Flags().IntVarP(&port, "port", "p", 2746, "Port to listen on")
186-
command.Flags().StringVar(&baseHRef, "basehref", "/", "Value for base href in index.html. Used if the server is running behind reverse proxy under subpath different from /. Defaults to the environment variable BASE_HREF.")
191+
command.Flags().StringVar(&baseHRef, "basehref", defaultBaseHRef, "Value for base href in index.html. Used if the server is running behind reverse proxy under subpath different from /. Defaults to the environment variable BASE_HREF.")
187192
// "-e" for encrypt, like zip
188193
command.Flags().BoolVarP(&secure, "secure", "e", true, "Whether or not we should listen on TLS.")
189194
command.Flags().BoolVar(&htst, "hsts", true, "Whether or not we should add a HTTP Secure Transport Security header. This only has effect if secure is enabled.")

0 commit comments

Comments
 (0)