From deaaa33ab9159b48dc8cf22277cc235ed463424f Mon Sep 17 00:00:00 2001 From: patrick heyroth Date: Wed, 8 Dec 2021 11:46:57 +0100 Subject: [PATCH] Make API behaviour more consistant --- .../service/SettingsHttpServiceImpl.java | 24 +++++++++++++++---- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/src/main/java/de/aservo/confapi/fisheye/service/SettingsHttpServiceImpl.java b/src/main/java/de/aservo/confapi/fisheye/service/SettingsHttpServiceImpl.java index c92eca7..b62fe1d 100644 --- a/src/main/java/de/aservo/confapi/fisheye/service/SettingsHttpServiceImpl.java +++ b/src/main/java/de/aservo/confapi/fisheye/service/SettingsHttpServiceImpl.java @@ -48,11 +48,25 @@ public SettingsHttpBean getSettings() { public SettingsHttpBean setSettings( SettingsHttpBean settings) { - server.setContext(settings.getWebContext()); - http.setBind(settings.getBindAddress()); - http.setProxyScheme(settings.getProxyScheme()); - http.setProxyHost(settings.getProxyHost()); - http.setProxyPort(BigInteger.valueOf(settings.getProxyPort())); + if(settings.getWebContext() != null){ + server.setContext(settings.getWebContext()); + } + + if(settings.getBindAddress() != null){ + http.setBind(settings.getBindAddress()); + } + + if(settings.getProxyScheme() != null){ + http.setProxyScheme(settings.getProxyScheme()); + } + + if(settings.getProxyHost() != null){ + http.setProxyHost(settings.getProxyHost()); + } + + if(settings.getProxyPort() != null){ + http.setProxyPort(BigInteger.valueOf(settings.getProxyPort())); + } return getSettings(); }