Skip to content

Commit 9f41b3a

Browse files
committed
make proxy base path check more robust
1 parent 6e0a457 commit 9f41b3a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/main/java/edu/kit/scc/dem/wapsrv/app/WapServerConfig.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
import org.springframework.beans.factory.annotation.Value;
1414
import org.springframework.context.annotation.Configuration;
1515
import org.springframework.util.PathMatcher;
16+
import org.springframework.util.StringUtils;
1617
import org.springframework.web.servlet.config.annotation.CorsRegistry;
1718
import org.springframework.web.servlet.config.annotation.PathMatchConfigurer;
1819
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
@@ -825,7 +826,7 @@ public boolean isRootWapUrl(String url){
825826
* @return The base url
826827
*/
827828
public String getBaseUrl(){
828-
if(proxiedBasePath != null && proxiedBasePath != "") return proxiedBasePath;
829+
if(StringUtils.hasText(proxiedBasePath))return proxiedBasePath;
829830
if(enableHttps){
830831
if(wapPort == 443){
831832
return "https://" + hostname + contextPath;

0 commit comments

Comments
 (0)