~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/transport/http/_urllib2_wrappers.py

  • Committer: Vincent Ladeuil
  • Date: 2011-06-07 12:25:45 UTC
  • mto: This revision was merged to the branch mainline in revision 5962.
  • Revision ID: v.ladeuil+lp@free.fr-20110607122545-fx8ao2x977ettbv2
Mask credentials in the -Dhttp logging

Show diffs side-by-side

added added

removed removed

Lines of Context:
648
648
                                     headers)
649
649
            if 'http' in debug.debug_flags:
650
650
                trace.mutter('> %s %s' % (method, url))
651
 
                hdrs = ['%s: %s' % (k, v) for k,v in headers.items()]
 
651
                hdrs = []
 
652
                for k,v in headers.iteritems():
 
653
                    # People are often told to paste -Dhttp output to help
 
654
                    # debug. Don't compromise credentials.
 
655
                    if k in ('Authorization', 'Proxy-Authorization'):
 
656
                        v = '<masked>'
 
657
                    hdrs.append('%s: %s' % (k, v))
652
658
                trace.mutter('> ' + '\n> '.join(hdrs) + '\n')
653
659
            if self._debuglevel >= 1:
654
660
                print 'Request sent: [%r] from (%s)' \