Skip to content

Commit

Permalink
Merge pull request #1779 from BorderTech/feature/fix-css-cache-buster
Browse files Browse the repository at this point in the history
Fix style.js loader to add the cache buster
  • Loading branch information
jonathanaustin authored Jun 16, 2021
2 parents 36cb3f7 + 74c6d6d commit 6a8be16
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/github-actions-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ jobs:
restore-keys: ${{ runner.os }}-m2

- name: Build Test and Verify
run: mvn -B -U clean verify -Dmaven.javadoc.skip=true -Dpmd.verbose=false -DskipOptionalQA=true -PskipCoreOptionalTests
run: mvn -B -U clean install -Dmaven.javadoc.skip=true -Dpmd.verbose=false -DskipOptionalQA=true -PskipCoreOptionalTests
env:
MOZ_HEADLESS: 1

- name: SonarCloud Scan
run: |
if ["$SONAR_TOKEN"] == ""; then
if ["$SONAR_TOKEN" == ""]; then
echo "Sonar secure variables NOT available"
else
echo "Sonar secure variables ARE available"
Expand Down
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
### Enhancements
### Bug Fixes

* Fix style.js loader to add the cache buster to URLs loaded #1778.

## 1.5.25

### Bug Fixes
Expand Down
8 changes: 5 additions & 3 deletions wcomponents-theme/src/main/js/wc/loader/style.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,11 @@ define(["wc/has", "wc/mixin", "wc/urlParser", "wc/config", "wc/dom/tag"], functi
*/
function getCachebusterFromMainCss() {
var cssUrl = instance.getMainCss(true),
parsedUrl;
if (cssUrl && (parsedUrl = urlParser.parse(cssUrl))) {
return parsedUrl.queryString;
parsedUrl,
parsedSearch;
if (cssUrl && (parsedUrl = urlParser.parse(cssUrl)) && (parsedSearch = parsedUrl.search)) {
// If parsed URL has a search queryString it is always prefixed with a ?
return parsedSearch.substring(1, parsedSearch.length);
}
return ""; // no cachebuster
}
Expand Down

0 comments on commit 6a8be16

Please sign in to comment.