Ticket #1029: http_check2.patch

File http_check2.patch, 989 bytes (added by lucian, 12 years ago)
  • downloadmanager.py

    diff --git a/downloadmanager.py b/downloadmanager.py
    index 8402b81..bd2a8e4 100644
    a b def save_link(url, text, owner_document): 
    311311        interfaces.nsIRequest.LOAD_BYPASS_CACHE | \
    312312        interfaces.nsIChannel.LOAD_CALL_CONTENT_SNIFFERS
    313313
    314     if _implements_interface(channel, interfaces.nsIHttpChannel):
    315         channel.referrer = io_service.newURI(owner_document.documentURI, None,
    316                                              None)
     314    # HACK when we QI for nsIHttpChannel on objects that implement just nsIChannel,
     315    # pyxpcom gets confused. see  trac #1029
     316    if uri.scheme == 'http':
     317        if _implements_interface(channel, interfaces.nsIHttpChannel):
     318            channel.referrer = io_service.newURI(owner_document.documentURI,
     319                                                 None, None)
    317320
    318321    # kick off the channel with our proxy object as the listener
    319322    listener = xpcom.server.WrapObject(