@ -31,6 +31,7 @@ import org.springframework.boot.autoconfigure.condition.ConditionalOnClass;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean ;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean ;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty ;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty ;
import org.springframework.boot.autoconfigure.security.SecurityProperties ;
import org.springframework.boot.autoconfigure.security.SecurityProperties ;
import org.springframework.boot.autoconfigure.web.ServerProperties ;
import org.springframework.boot.context.properties.EnableConfigurationProperties ;
import org.springframework.boot.context.properties.EnableConfigurationProperties ;
import org.springframework.boot.devtools.remote.server.AccessManager ;
import org.springframework.boot.devtools.remote.server.AccessManager ;
import org.springframework.boot.devtools.remote.server.Dispatcher ;
import org.springframework.boot.devtools.remote.server.Dispatcher ;
@ -76,6 +77,9 @@ public class RemoteDevToolsAutoConfiguration {
@Autowired
@Autowired
private DevToolsProperties properties ;
private DevToolsProperties properties ;
@Autowired
private ServerProperties serverProperties ;
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
public AccessManager remoteDevToolsAccessManager ( ) {
public AccessManager remoteDevToolsAccessManager ( ) {
@ -87,8 +91,9 @@ public class RemoteDevToolsAutoConfiguration {
@Bean
@Bean
public HandlerMapper remoteDevToolsHealthCheckHandlerMapper ( ) {
public HandlerMapper remoteDevToolsHealthCheckHandlerMapper ( ) {
Handler handler = new HttpStatusHandler ( ) ;
Handler handler = new HttpStatusHandler ( ) ;
return new UrlHandlerMapper ( this . properties . getRemote ( ) . getContextPath ( ) ,
return new UrlHandlerMapper ( ( this . serverProperties . getContextPath ( ) = = null ? ""
handler ) ;
: this . serverProperties . getContextPath ( ) )
+ this . properties . getRemote ( ) . getContextPath ( ) , handler ) ;
}
}
@Bean
@Bean
@ -108,6 +113,9 @@ public class RemoteDevToolsAutoConfiguration {
@Autowired
@Autowired
private DevToolsProperties properties ;
private DevToolsProperties properties ;
@Autowired
private ServerProperties serverProperties ;
@Bean
@Bean
@ConditionalOnMissingBean
@ConditionalOnMissingBean
public SourceFolderUrlFilter remoteRestartSourceFolderUrlFilter ( ) {
public SourceFolderUrlFilter remoteRestartSourceFolderUrlFilter ( ) {
@ -124,7 +132,9 @@ public class RemoteDevToolsAutoConfiguration {
@Bean
@Bean
@ConditionalOnMissingBean ( name = "remoteRestartHanderMapper" )
@ConditionalOnMissingBean ( name = "remoteRestartHanderMapper" )
public UrlHandlerMapper remoteRestartHanderMapper ( HttpRestartServer server ) {
public UrlHandlerMapper remoteRestartHanderMapper ( HttpRestartServer server ) {
String url = this . properties . getRemote ( ) . getContextPath ( ) + "/restart" ;
String url = ( this . serverProperties . getContextPath ( ) = = null ? ""
: this . serverProperties . getContextPath ( ) )
+ this . properties . getRemote ( ) . getContextPath ( ) + "/restart" ;
logger . warn ( "Listening for remote restart updates on " + url ) ;
logger . warn ( "Listening for remote restart updates on " + url ) ;
Handler handler = new HttpRestartServerHandler ( server ) ;
Handler handler = new HttpRestartServerHandler ( server ) ;
return new UrlHandlerMapper ( url , handler ) ;
return new UrlHandlerMapper ( url , handler ) ;
@ -141,11 +151,16 @@ public class RemoteDevToolsAutoConfiguration {
@Autowired
@Autowired
private DevToolsProperties properties ;
private DevToolsProperties properties ;
@Autowired
private ServerProperties serverProperties ;
@Bean
@Bean
@ConditionalOnMissingBean ( name = "remoteDebugHanderMapper" )
@ConditionalOnMissingBean ( name = "remoteDebugHanderMapper" )
public UrlHandlerMapper remoteDebugHanderMapper (
public UrlHandlerMapper remoteDebugHanderMapper (
@Qualifier ( "remoteDebugHttpTunnelServer" ) HttpTunnelServer server ) {
@Qualifier ( "remoteDebugHttpTunnelServer" ) HttpTunnelServer server ) {
String url = this . properties . getRemote ( ) . getContextPath ( ) + "/debug" ;
String url = ( this . serverProperties . getContextPath ( ) = = null ? ""
: this . serverProperties . getContextPath ( ) )
+ this . properties . getRemote ( ) . getContextPath ( ) + "/debug" ;
logger . warn ( "Listening for remote debug traffic on " + url ) ;
logger . warn ( "Listening for remote debug traffic on " + url ) ;
Handler handler = new HttpTunnelServerHandler ( server ) ;
Handler handler = new HttpTunnelServerHandler ( server ) ;
return new UrlHandlerMapper ( url , handler ) ;
return new UrlHandlerMapper ( url , handler ) ;