For debugging, I add the following lines here:

    p header.to_s
    p header.decoded