File tree 1 file changed +11
-2
lines changed
spring-web/src/main/java/org/springframework/web/server/adapter
1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 1
1
/*
2
- * Copyright 2002-2020 the original author or authors.
2
+ * Copyright 2002-2021 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -228,7 +228,16 @@ public void afterPropertiesSet() {
228
228
@ Override
229
229
public Mono <Void > handle (ServerHttpRequest request , ServerHttpResponse response ) {
230
230
if (this .forwardedHeaderTransformer != null ) {
231
- request = this .forwardedHeaderTransformer .apply (request );
231
+ try {
232
+ request = this .forwardedHeaderTransformer .apply (request );
233
+ }
234
+ catch (Throwable ex ) {
235
+ if (logger .isDebugEnabled ()) {
236
+ logger .debug ("Failed to apply forwarded headers to " + formatRequest (request ), ex );
237
+ }
238
+ response .setStatusCode (HttpStatus .BAD_REQUEST );
239
+ return response .setComplete ();
240
+ }
232
241
}
233
242
ServerWebExchange exchange = createExchange (request , response );
234
243
You can’t perform that action at this time.
0 commit comments