Merge pull request #11820 from hashicorp/improve-ui-disabled-api-response

http: improve UI not enabled response message
This commit is contained in:
Jared Kirschner 2022-01-03 12:00:01 -05:00 committed by GitHub
commit d26f8e4529
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

3
.changelog/11820.txt Normal file
View File

@ -0,0 +1,3 @@
```release-note:improvement
http: when a user attempts to access the UI but can't because it's disabled, explain this and how to fix it
```

View File

@ -599,7 +599,7 @@ func (s *HTTPHandlers) Index(resp http.ResponseWriter, req *http.Request) {
// Give them something helpful if there's no UI so they at least know
// what this server is.
if !s.IsUIEnabled() {
fmt.Fprint(resp, "Consul Agent")
fmt.Fprint(resp, "Consul Agent: UI disabled. To enable, set ui_config.enabled=true in the agent configuration and restart.")
return
}