Skip to content

Commit

Permalink
Use request version as fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
patrickbrophy committed Dec 2, 2024
1 parent 54de7ec commit 6e31d25
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions director/director.go
Original file line number Diff line number Diff line change
Expand Up @@ -1137,6 +1137,15 @@ func registerServeAd(engineCtx context.Context, ctx *gin.Context, sType server_s
adV2.DisableDirectorTest = true
}

// if we didn't receive a version but we were able to extract the request version from the user agent,
// then we can use the request version as the server version (they should be the same)
// otherwise, we set the version to unknown because our sources of truth are not available
if adV2.Version == "" && reqVer != nil {
adV2.Version = reqVer.String()
} else {
adV2.Version = "unknown"
}

sAd := server_structs.ServerAd{
Name: adV2.Name,
StorageType: st,
Expand Down

0 comments on commit 6e31d25

Please sign in to comment.