Uploaded image for project: 'Drools'
  1. Drools
  2. DROOLS-66

It is impossible to switch off URL caching if https protocol is used

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major Major
    • 6.0.0.Alpha9
    • None
    • None
    • None

      It is impossible to switch off URL caching if https protocol is used

      When used https to load resources from HTTP, a conditional mistake try to cache the content even though CACHE_DIR is null:

      // class org.drools.io.impl.UrlResource

      public InputStream getInputStream() throws IOException {
      (...)
      if (lastMod > 0 && lastMod > lastRead) {
      if (CACHE_DIR != null && url.getProtocol().equals("http") || url.getProtocol().equals("https"))

      { //lets grab a copy and cache it in case we need it in future... cacheStream(); }

      }
      (...)
      }

      IF only "https" was evaluated as true - ((false && false) || true) - so the exit will be true, which should be not the expected behaviour

      That code should be:

      if (CACHE_DIR != null && (url.getProtocol().equals("http") || url.getProtocol().equals("https"))) {
      //lets grab a copy and cache it in case we need it in future...
      cacheStream();
      }

            mproctor@redhat.com Mark Proctor
            rhn-support-alazarot Alessandro Lazarotti
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: