Skip to content
This repository was archived by the owner on Dec 19, 2023. It is now read-only.

Commit 9028135

Browse files
feat(#212): normalizing slashes in Playground static resource URLs
1 parent b302e33 commit 9028135

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

playground-spring-boot-autoconfigure/src/main/java/com/oembedler/moon/playground/boot/PlaygroundController.java

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@
77
import org.springframework.web.bind.annotation.GetMapping;
88

99
import javax.servlet.http.HttpServletRequest;
10-
import java.nio.file.Path;
1110
import java.nio.file.Paths;
1211

1312
@Controller
@@ -42,13 +41,14 @@ public String playground(final Model model, final HttpServletRequest request) {
4241
return "playground";
4342
}
4443

45-
private String getCdnUrl(final String assetUrl) {
44+
private String getCdnUrl(final String assetPath) {
4645
return String.format("%s@%s/build/%s", CDN_ROOT, propertiesConfiguration.getPlayground().getCdn().getVersion(),
47-
assetUrl);
46+
assetPath);
4847
}
4948

50-
private Path getLocalUrl(final String cssPath) {
51-
return Paths.get(propertiesConfiguration.getPlayground().getStaticPath().getBase(), cssPath);
49+
private String getLocalUrl(final String assetPath) {
50+
return Paths.get(propertiesConfiguration.getPlayground().getStaticPath().getBase(), assetPath).toString()
51+
.replace('\\', '/');
5252
}
5353

5454
private void setCdnUrls(final Model model) {

0 commit comments

Comments
 (0)