Ticket #1029: http_check3.patch

File http_check3.patch, 1.3 KB (added by lucian, 12 years ago)

improvement in the alert and journal object title

  • downloadmanager.py

    diff --git a/downloadmanager.py b/downloadmanager.py
    index 8402b81..d52e164 100644
    a b class Download: 
    252252    def _get_file_name(self):
    253253        if self._display_name:
    254254            return self._display_name
     255        elif self._source.scheme == 'data':
     256            return 'data URI'
    255257        else:
    256258            path = urlparse.urlparse(self._source.spec).path
    257259            location, file_name = os.path.split(path)
    def save_link(url, text, owner_document): 
    311313        interfaces.nsIRequest.LOAD_BYPASS_CACHE | \
    312314        interfaces.nsIChannel.LOAD_CALL_CONTENT_SNIFFERS
    313315
    314     if _implements_interface(channel, interfaces.nsIHttpChannel):
    315         channel.referrer = io_service.newURI(owner_document.documentURI, None,
    316                                              None)
     316    # HACK: when we QI for nsIHttpChannel on objects that implement
     317    # just nsIChannel, pyxpcom gets confused. see  trac #1029
     318    if uri.scheme == 'http':
     319        if _implements_interface(channel, interfaces.nsIHttpChannel):
     320            channel.referrer = io_service.newURI(owner_document.documentURI,
     321                                                 None, None)
    317322
    318323    # kick off the channel with our proxy object as the listener
    319324    listener = xpcom.server.WrapObject(