Bug 913252 - It is impossible to switch off URL caching if https protocol is used
Summary: It is impossible to switch off URL caching if https protocol is used
Keywords:
Status: VERIFIED
Alias: None
Product: JBoss Enterprise BRMS Platform 5
Classification: JBoss
Component: BRE (Expert, Fusion)
Version: BRMS 5.3.1
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: One Off Releases
Assignee: Nobody
QA Contact:
URL:
Whiteboard:
Depends On:
Blocks: 873846
TreeView+ depends on / blocked
 
Reported: 2013-02-20 17:52 UTC by Alessandro Lazarotti
Modified: 2024-01-01 01:36 UTC (History)
0 users

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Issue Tracker DROOLS-66 0 Major Closed It is impossible to switch off URL caching if https protocol is used 2013-11-05 06:04:25 UTC

Description Alessandro Lazarotti 2013-02-20 17:52:03 UTC
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();
}

Comment 1 Alessandro Lazarotti 2013-03-04 21:18:54 UTC
Pull Request: https://github.com/droolsjbpm/drools/pull/182

Comment 2 JBoss JIRA Server 2013-03-04 21:51:18 UTC
Alessandro Lazarotti <alazarot> updated the status of jira DROOLS-66 to Resolved

Comment 3 JBoss JIRA Server 2013-03-04 21:51:18 UTC
Alessandro Lazarotti <alazarot> made a comment on jira DROOLS-66

merged in 5.3.x, 5.4.x, 5.5.x and master (6.0.x) branch

Comment 4 JBoss JIRA Server 2013-03-04 21:55:05 UTC
Alessandro Lazarotti <alazarot> updated the status of jira DROOLS-66 to Closed

Comment 5 Julian Coleman 2013-03-20 12:41:54 UTC
Included in roll-up #1: BZ-873846

Comment 6 Marek Winkler 2013-04-02 08:16:33 UTC
Verified on 5.3.1.BRMS-P02.


Note You need to log in before you can comment on or make changes to this bug.