diff options
author | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-10-19 00:15:41 -0400 |
---|---|---|
committer | pg9182 <96569817+pg9182@users.noreply.github.com> | 2022-10-19 00:15:41 -0400 |
commit | 8805e96a6285a70d512b840ae45d046a1d0e8b26 (patch) | |
tree | bd4e588d6d7967209699e1b4a8774a419eea36be | |
parent | a2a99f900ec81142a946e7d5a4487a5d1d045d47 (diff) | |
download | Atlas-8805e96a6285a70d512b840ae45d046a1d0e8b26.tar.gz Atlas-8805e96a6285a70d512b840ae45d046a1d0e8b26.zip |
pkg/api/api0: Check length during launcher version extraction
-rw-r--r-- | pkg/api/api0/api.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/pkg/api/api0/api.go b/pkg/api/api0/api.go index 51d3c18..180bbfc 100644 --- a/pkg/api/api0/api.go +++ b/pkg/api/api0/api.go @@ -120,7 +120,7 @@ func (h *Handler) ServeHTTP(w http.ResponseWriter, r *http.Request) { func (h *Handler) checkLauncherVersion(r *http.Request) bool { rver, _, _ := strings.Cut(r.Header.Get("User-Agent"), " ") if x := strings.TrimPrefix(rver, "R2Northstar/"); rver != x { - if x[0] != 'v' { + if len(x) > 0 && x[0] != 'v' { rver = "v" + x } else { rver = x |