Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CssLinkResourceTransformer throws Exception on links that start with // [SPR-12632] #17233

Closed
spring-issuemaster opened this issue Jan 14, 2015 · 3 comments

Comments

Projects
None yet
2 participants
@spring-issuemaster
Copy link
Collaborator

commented Jan 14, 2015

Christopher Savory opened SPR-12632 and commented

We have background images in our CSS that are served off the CDN. Instead of prefixing with http:// or https://, we start them with //.

CssLinkResourceTransformer will throw an IllegalStateException state exception when it encounters one of these. I see there is a hasScheme method, but it seems to only be looking for http or https.

java.lang.IllegalStateException: Failed to get public resource URL path for d2lwa1fwilioys.cloudfront.net/elrc/img/content/global/feedbackIcon.png
	at org.springframework.web.servlet.resource.ResourceUrlProvider.getForLookupPath(ResourceUrlProvider.java:211)
	at org.springframework.web.servlet.resource.ResourceUrlProvider.getForRequestUrl(ResourceUrlProvider.java:174)
	at org.springframework.web.servlet.resource.ResourceTransformerSupport.resolveUrlPath(ResourceTransformerSupport.java:81)
	at org.springframework.web.servlet.resource.CssLinkResourceTransformer.transform(CssLinkResourceTransformer.java:106)

Affects: 4.1.3

Referenced from: commits 028c0e8, bb5da15

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 16, 2015

Christopher Savory commented

Brian, It would be nice if there was an ExternalResourceTansformer for resources that are served off of a CDN. Either a CDN that was a reverse proxy to a site or perhaps was backed with something else like Amazon's S3. In the case of the later, we would have to know the destination of the CDN as well as the source system that owned the resource.

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 20, 2015

Brian Clozel commented

Christopher Savory something like #16488 ?

@spring-issuemaster

This comment has been minimized.

Copy link
Collaborator Author

commented Jan 20, 2015

Christopher Savory commented

Brian Clozel yes exactly!! Why is that resolved as Won't Fix? A CDNResourceResolver would be a great benefit to have.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.