How to determine if post has widget content?

<?php
$bodyclass = "";
// are we on a 'single' page? e.g. a post or page or some other custom post type?
if(is_single()){
    // is this a post of type 'page'? or is it a blogpost?
    global $post;
    if($post->post_type == 'page'){
        // good now to check if we have a sidebar with active content
        if( is_active_sidebar('my-header')){
            $bodyclass="wehavesidebarcontentyay";
        }
    }
}

?>
<body <?php body_class($bodyclass); ?>>

Though I’m sure if you have body_class on your body tag then you already have the needed css classes and selectors to do this without the PHP code.