mirror of
https://github.com/portainer/portainer.git
synced 2025-07-23 07:19:41 +02:00
fix(libclient): option to disable external http request [BE-11696] (#745)
This commit is contained in:
parent
ee65223ee7
commit
e243a6bf1c
5 changed files with 51 additions and 2 deletions
|
@ -7,6 +7,7 @@ import (
|
|||
"github.com/portainer/portainer/api/http/client"
|
||||
"github.com/portainer/portainer/api/http/security"
|
||||
"github.com/portainer/portainer/pkg/build"
|
||||
libclient "github.com/portainer/portainer/pkg/libhttp/client"
|
||||
httperror "github.com/portainer/portainer/pkg/libhttp/error"
|
||||
"github.com/portainer/portainer/pkg/libhttp/response"
|
||||
|
||||
|
@ -69,10 +70,14 @@ func (handler *Handler) version(w http.ResponseWriter, r *http.Request) *httperr
|
|||
}
|
||||
|
||||
func GetLatestVersion() string {
|
||||
if err := libclient.ExternalRequestDisabled(portainer.VersionCheckURL); err != nil {
|
||||
log.Debug().Err(err).Msg("External request disabled: Version check")
|
||||
return ""
|
||||
}
|
||||
|
||||
motd, err := client.Get(portainer.VersionCheckURL, 5)
|
||||
if err != nil {
|
||||
log.Debug().Err(err).Msg("couldn't fetch latest Portainer release version")
|
||||
|
||||
return ""
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue