@@ -205,7 +205,7 @@ public static Optional<ServerOptions> from(Config conf) {
205205 // ssl
206206 SslOptions .from (conf , "server.ssl" ).ifPresent (options ::setSsl );
207207 if (conf .hasPath ("server.httpsOnly" )) {
208- options .httpsOnly = conf .getBoolean ("server.httpsOnly" );
208+ options .setHttpsOnly ( conf .getBoolean ("server.httpsOnly" ) );
209209 }
210210 if (conf .hasPath ("server.http2" )) {
211211 options .setHttp2 (conf .getBoolean ("server.http2" ));
@@ -241,6 +241,7 @@ public String toString() {
241241 */
242242 public ServerOptions setServer (String server ) {
243243 this .server = server ;
244+ this .defaults = false ;
244245 return this ;
245246 }
246247
@@ -270,6 +271,7 @@ public int getPort() {
270271 */
271272 public ServerOptions setPort (int port ) {
272273 this .port = Math .max (0 , port );
274+ this .defaults = false ;
273275 return this ;
274276 }
275277
@@ -303,6 +305,7 @@ public ServerOptions setSecurePort(@Nullable Integer securePort) {
303305 } else {
304306 this .securePort = Math .max (0 , securePort );
305307 }
308+ this .defaults = false ;
306309 return this ;
307310 }
308311
@@ -323,6 +326,7 @@ public boolean isHttpsOnly() {
323326 */
324327 public ServerOptions setHttpsOnly (boolean httpsOnly ) {
325328 this .httpsOnly = httpsOnly ;
329+ this .defaults = false ;
326330 return this ;
327331 }
328332
@@ -343,6 +347,7 @@ public int getIoThreads() {
343347 */
344348 public ServerOptions setIoThreads (int ioThreads ) {
345349 this .ioThreads = ioThreads ;
350+ this .defaults = false ;
346351 return this ;
347352 }
348353
@@ -366,6 +371,7 @@ public int getWorkerThreads() {
366371 */
367372 public ServerOptions setWorkerThreads (int workerThreads ) {
368373 this .workerThreads = workerThreads ;
374+ this .defaults = false ;
369375 return this ;
370376 }
371377
@@ -388,6 +394,7 @@ public ServerOptions setWorkerThreads(int workerThreads) {
388394 */
389395 public ServerOptions setCompressionLevel (@ Nullable Integer compressionLevel ) {
390396 this .compressionLevel = compressionLevel ;
397+ this .defaults = false ;
391398 return this ;
392399 }
393400
@@ -411,6 +418,7 @@ public boolean getDefaultHeaders() {
411418 */
412419 public ServerOptions setDefaultHeaders (boolean defaultHeaders ) {
413420 this .defaultHeaders = defaultHeaders ;
421+ this .defaults = false ;
414422 return this ;
415423 }
416424
@@ -431,6 +439,7 @@ public OutputOptions getOutput() {
431439 */
432440 public ServerOptions setOutput (OutputOptions output ) {
433441 this .output = output ;
442+ this .defaults = false ;
434443 return this ;
435444 }
436445
@@ -452,6 +461,7 @@ public int getMaxRequestSize() {
452461 */
453462 public ServerOptions setMaxRequestSize (int maxRequestSize ) {
454463 this .maxRequestSize = maxRequestSize ;
464+ this .defaults = false ;
455465 return this ;
456466 }
457467
@@ -472,6 +482,7 @@ public int getMaxFormFields() {
472482 */
473483 public ServerOptions setMaxFormFields (int maxFormFields ) {
474484 this .maxFormFields = maxFormFields ;
485+ this .defaults = false ;
475486 return this ;
476487 }
477488
@@ -500,6 +511,7 @@ public int getMaxHeaderSize() {
500511 */
501512 public ServerOptions setMaxHeaderSize (int maxHeaderSize ) {
502513 this .maxHeaderSize = maxHeaderSize ;
514+ this .defaults = false ;
503515 return this ;
504516 }
505517
@@ -519,11 +531,12 @@ public String getHost() {
519531 * @return This options.
520532 */
521533 public ServerOptions setHost (String host ) {
522- if (host == null || host .trim ().length () == 0 || "localhost" .equalsIgnoreCase (host .trim ())) {
534+ if (host == null || host .trim ().isEmpty () || "localhost" .equalsIgnoreCase (host .trim ())) {
523535 this .host = LOCAL_HOST ;
524536 } else {
525537 this .host = host ;
526538 }
539+ this .defaults = false ;
527540 return this ;
528541 }
529542
@@ -544,6 +557,7 @@ public ServerOptions setHost(String host) {
544557 */
545558 public ServerOptions setSsl (@ Nullable SslOptions ssl ) {
546559 this .ssl = ssl ;
560+ this .defaults = false ;
547561 return this ;
548562 }
549563
@@ -567,6 +581,7 @@ public ServerOptions setSsl(@Nullable SslOptions ssl) {
567581 */
568582 public ServerOptions setHttp2 (@ Nullable Boolean http2 ) {
569583 this .http2 = http2 ;
584+ this .defaults = false ;
570585 return this ;
571586 }
572587
@@ -589,6 +604,7 @@ public ServerOptions setHttp2(@Nullable Boolean http2) {
589604 */
590605 public ServerOptions setExpectContinue (@ Nullable Boolean expectContinue ) {
591606 this .expectContinue = expectContinue ;
607+ this .defaults = false ;
592608 return this ;
593609 }
594610
0 commit comments