func UpdateAppCtxWithRuntimeRelease()

in lambda/appctx/appctxutil.go [102:120]


func UpdateAppCtxWithRuntimeRelease(request *http.Request, appCtx ApplicationContext) bool {
	// If appCtx has runtime release value already, just append the runtime features.
	if appCtxRuntimeRelease := GetRuntimeRelease(appCtx); len(appCtxRuntimeRelease) > 0 {
		// if the runtime features are not appended before append them, otherwise ignore
		if runtimeReleaseWithFeatures := CreateRuntimeReleaseFromRequest(request, appCtxRuntimeRelease); len(runtimeReleaseWithFeatures) > len(appCtxRuntimeRelease) &&
			appCtxRuntimeRelease[len(appCtxRuntimeRelease)-1] != ')' {
			appCtx.Store(AppCtxRuntimeReleaseKey, runtimeReleaseWithFeatures)
			return true
		}
		return false
	}
	// If appCtx doesn't have runtime release value, update it with user agent and runtime features.
	if runtimeReleaseWithFeatures := CreateRuntimeReleaseFromRequest(request,
		GetUserAgentFromRequest(request)); runtimeReleaseWithFeatures != "" {
		appCtx.Store(AppCtxRuntimeReleaseKey, runtimeReleaseWithFeatures)
		return true
	}
	return false
}