Skip to content
  • Stefano Crocco's avatar
    Avoid another possible endless loop · 342100e9
    Stefano Crocco authored and David Faure's avatar David Faure committed
    This is a corner case, but it could, at least in theory, happen:
    - WebEnginePart determines application/octet-stream as mimetype for a
      given URL and passes it to KonqMainWindow::openURL, which in turn uses
      UrlLoader
    - UrlLoader uses OpenUrlJob to make another attempt at determine the
      mimetype and finds that it's actually a mimetype supported by
      WebEnginePart (for example, application/xml)
    - if the user chose to embed the mimetype and the preferred service is
      WebEnginePart, we get an endless loop because WebEnginePart thinks it
      can't handle the URL (it finds again application/octet-stream), calls
      again KonqMainWindow::openURL and so on
    
    To avoid this, when the preferred part is WebEnginePart but the URL has
    already been processed by WebEnginePart, the second preferred part is
    used. If there's only one availlable part, the user is asked wether to
    open or save.
    342100e9