LPS-46567 Use server-side detection instead client-side to avoid sending JS code to browser