diff --git a/libresonic-main/src/main/java/org/libresonic/player/boot/Application.java b/libresonic-main/src/main/java/org/libresonic/player/boot/Application.java index 297e3e6d..28b75c8e 100644 --- a/libresonic-main/src/main/java/org/libresonic/player/boot/Application.java +++ b/libresonic-main/src/main/java/org/libresonic/player/boot/Application.java @@ -1,9 +1,12 @@ package org.libresonic.player.boot; +import org.directwebremoting.servlet.DwrServlet; import org.springframework.boot.SpringApplication; import org.springframework.boot.autoconfigure.SpringBootApplication; import org.springframework.boot.builder.SpringApplicationBuilder; +import org.springframework.boot.web.servlet.ServletRegistrationBean; import org.springframework.boot.web.support.SpringBootServletInitializer; +import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.context.annotation.ImportResource; @@ -16,6 +19,14 @@ import org.springframework.context.annotation.ImportResource; "classpath:/libresonic-servlet.xml"}) public class Application extends SpringBootServletInitializer { + @Bean + public ServletRegistrationBean dwrServletRegistrationBean() { + ServletRegistrationBean servlet = new ServletRegistrationBean(new DwrServlet(), "/dwr/*"); + servlet.addInitParameter("crossDomainSessionSecurity","false"); + return servlet; + } + + @Override protected SpringApplicationBuilder configure(SpringApplicationBuilder application) { // Customize the application or call application.sources(...) to add sources