aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-19 00:15:41 -0400
committerpg9182 <96569817+pg9182@users.noreply.github.com>2022-10-19 00:15:41 -0400
commit8805e96a6285a70d512b840ae45d046a1d0e8b26 (patch)
treebd4e588d6d7967209699e1b4a8774a419eea36be
parenta2a99f900ec81142a946e7d5a4487a5d1d045d47 (diff)
downloadAtlas-8805e96a6285a70d512b840ae45d046a1d0e8b26.tar.gz
Atlas-8805e96a6285a70d512b840ae45d046a1d0e8b26.zip
pkg/api/api0: Check length during launcher version extraction
-rw-r--r--pkg/api/api0/api.go2
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