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.
@@ -224,7 +224,16 @@ public void afterPropertiesSet() {
224
224
@ Override
225
225
public Mono <Void > handle (ServerHttpRequest request , ServerHttpResponse response ) {
226
226
if (this .forwardedHeaderTransformer != null ) {
227
- request = this .forwardedHeaderTransformer .apply (request );
227
+ try {
228
+ request = this .forwardedHeaderTransformer .apply (request );
229
+ }
230
+ catch (Throwable ex ) {
231
+ if (logger .isDebugEnabled ()) {
232
+ logger .debug ("Failed to apply forwarded headers to " + formatRequest (request ), ex );
233
+ }
234
+ response .setStatusCode (HttpStatus .BAD_REQUEST );
235
+ return response .setComplete ();
236
+ }
228
237
}
229
238
ServerWebExchange exchange = createExchange (request , response );
230
239
You can’t perform that action at this time.
0 commit comments