def copy_headers_into(from_r, to_r):
 for (k, v) in from_r.headers.items():
  if k.lower().startswith('x-object-meta-'):
   to_r.headers[k] = v

def copy_headers_into ( from_r , to_r ) : for ( k , v ) in from_r . headers . items ( ) : if k . lower ( ) . startswith ( 'x-object-meta-' ) : to_r . headers [ k ] = v
will copy desired headers from from_r to to_r .