File tree Expand file tree Collapse file tree 1 file changed +2
-8
lines changed
spring-webflux/src/main/java/org/springframework/web/reactive/function/server Expand file tree Collapse file tree 1 file changed +2
-8
lines changed Original file line number Diff line number Diff line change @@ -187,13 +187,7 @@ default PathContainer pathContainer() {
187
187
* @return the attribute value
188
188
*/
189
189
default Optional <Object > attribute (String name ) {
190
- Map <String , Object > attributes = attributes ();
191
- if (attributes .containsKey (name )) {
192
- return Optional .of (attributes .get (name ));
193
- }
194
- else {
195
- return Optional .empty ();
196
- }
190
+ return Optional .ofNullable (attributes ().get (name ));
197
191
}
198
192
199
193
/**
@@ -350,7 +344,7 @@ interface Headers {
350
344
Optional <MediaType > contentType ();
351
345
352
346
/**
353
- * Get the value of the required {@code Host} header.
347
+ * Get the value of the {@code Host} header, if available .
354
348
* <p>If the header value does not contain a port, the
355
349
* {@linkplain InetSocketAddress#getPort() port} in the returned address will
356
350
* be {@code 0}.
You can’t perform that action at this time.
0 commit comments