jaydata icon indicating copy to clipboard operation
jaydata copied to clipboard

Incorrect Provider URL requested when introduce cache bust in jaydata

Open shaqtsui opened this issue 11 years ago • 0 comments

The jaydata script url will be like: bower_components/infra-client/app/scripts/vendor/jaydata/jaydata.js?bust=xxxx.

The function getUrl() don't recognize this, so the provider URL be incorrectly parsed to: 'jaydataproviders/' + providerName + 'Provider.js'

getUrl Code:

getUrl: function (providerName) {
        var jaydataScriptMin = document.querySelector('script[src$="jaydata.min.js"]');
        var jaydataScript = document.querySelector('script[src$="jaydata.js"]');
        if (jaydataScriptMin) return jaydataScriptMin.src.substring(0, jaydataScriptMin.src.lastIndexOf('/') + 1) + 'jaydataproviders/' + providerName + 'Provider.min.js';
        else if (jaydataScript) return jaydataScript.src.substring(0, jaydataScript.src.lastIndexOf('/') + 1) + 'jaydataproviders/' + providerName + 'Provider.js';
        else return 'jaydataproviders/' + providerName + 'Provider.js';
    }

shaqtsui avatar Mar 17 '14 06:03 shaqtsui