Skip to content

Commit f5d4acd

Browse files
committed
Add warning if users are using removed server.use-forward-headers property
1 parent 1bcd08a commit f5d4acd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

src/main/java/eu/openanalytics/containerproxy/ContainerProxyApplication.java

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,12 +39,15 @@
3939

4040
import com.fasterxml.jackson.datatype.jsr353.JSR353Module;
4141

42+
import javax.annotation.PostConstruct;
4243
import javax.inject.Inject;
4344
import java.net.InetAddress;
4445
import java.net.UnknownHostException;
4546
import java.nio.file.Files;
4647
import java.nio.file.Paths;
4748
import java.util.Properties;
49+
import org.apache.logging.log4j.LogManager;
50+
import org.apache.logging.log4j.Logger;
4851

4952
@SpringBootApplication
5053
@ComponentScan("eu.openanalytics")
@@ -58,6 +61,8 @@ public class ContainerProxyApplication {
5861
@Inject
5962
private ProxyMappingManager mappingManager;
6063

64+
private final Logger log = LogManager.getLogger(getClass());
65+
6166
public static void main(String[] args) {
6267
SpringApplication app = new SpringApplication(ContainerProxyApplication.class);
6368

@@ -76,6 +81,13 @@ public static void main(String[] args) {
7681
if (e instanceof PortInUseException) System.exit(-1);
7782
}
7883
}
84+
85+
@PostConstruct
86+
public void init() {
87+
if (environment.getProperty("server.use-forward-headers") != null) {
88+
log.warn("WARNING: Using server.use-forward-headers will not work in this ShinyProxy release. See https://shinyproxy.io/documentation/security/#https-ssl--tls on how to change your configuration.");
89+
}
90+
}
7991

8092
@Bean
8193
public UndertowServletWebServerFactory servletContainer() {

0 commit comments

Comments
 (0)