diff --git a/bootstrap-sass/src/main/java/de/agilecoders/wicket/sass/BootstrapSass.java b/bootstrap-sass/src/main/java/de/agilecoders/wicket/sass/BootstrapSass.java index 04175db14..73be9d673 100644 --- a/bootstrap-sass/src/main/java/de/agilecoders/wicket/sass/BootstrapSass.java +++ b/bootstrap-sass/src/main/java/de/agilecoders/wicket/sass/BootstrapSass.java @@ -4,6 +4,7 @@ import org.apache.wicket.markup.html.IPackageResourceGuard; import org.apache.wicket.markup.html.SecurePackageResourceGuard; import org.apache.wicket.request.resource.IResourceReferenceFactory; +import org.apache.wicket.request.resource.IResourceUrlSanitizer; import org.apache.wicket.request.resource.ResourceReferenceRegistry; /** @@ -39,6 +40,10 @@ public static void install(final Application app, final SassCompilerOptionsFacto ResourceReferenceRegistry resourceReferenceRegistry = app.getResourceReferenceRegistry(); IResourceReferenceFactory delegate = resourceReferenceRegistry.getResourceReferenceFactory(); resourceReferenceRegistry.setResourceReferenceFactory(new SassResourceReferenceFactory(delegate)); + + IResourceUrlSanitizer sanitizer = app.getResourceSettings().getUrlSanitizer(); + SassResourceUrlSanitizer sassSanitizer = new SassResourceUrlSanitizer(sanitizer); + app.getResourceSettings().setUrlSanitizer(sassSanitizer); } /** diff --git a/bootstrap-sass/src/main/java/de/agilecoders/wicket/sass/SassResourceUrlSanitizer.java b/bootstrap-sass/src/main/java/de/agilecoders/wicket/sass/SassResourceUrlSanitizer.java new file mode 100644 index 000000000..d7d3de6e6 --- /dev/null +++ b/bootstrap-sass/src/main/java/de/agilecoders/wicket/sass/SassResourceUrlSanitizer.java @@ -0,0 +1,30 @@ +package de.agilecoders.wicket.sass; + +import org.apache.wicket.request.resource.IResourceUrlSanitizer; +import org.apache.wicket.request.resource.ResourceReference; + +public class SassResourceUrlSanitizer implements IResourceUrlSanitizer +{ + + private IResourceUrlSanitizer delegate; + + public SassResourceUrlSanitizer(IResourceUrlSanitizer delegate) + { + this.delegate = delegate; + } + + @Override + public ResourceReference.UrlAttributes sanitize(ResourceReference.UrlAttributes urlAttributes, + Class scope, String name) + { + if (ContextRelativeSassResourceReference.CONTEXT_RELATIVE_SASS_REFERENCE_VARIATION.equals( + urlAttributes.getVariation())) + { + return urlAttributes; + } + else + { + return delegate.sanitize(urlAttributes, scope, name); + } + } +} diff --git a/pom.xml b/pom.xml index 89d06fc22..5bc8eb0b0 100644 --- a/pom.xml +++ b/pom.xml @@ -73,7 +73,7 @@ 1.11.4 5.11.1 3.0 - 1.5.14 + 1.5.15 2.8.3-1 5.14.2 5.0.0