File tree Expand file tree Collapse file tree 1 file changed +11
-2
lines changed
spring-web/src/main/java/org/springframework/web/server/adapter Expand file tree Collapse file tree 1 file changed +11
-2
lines changed Original file line number Diff line number Diff line change 11/*
2- * Copyright 2002-2020 the original author or authors.
2+ * Copyright 2002-2021 the original author or authors.
33 *
44 * Licensed under the Apache License, Version 2.0 (the "License");
55 * you may not use this file except in compliance with the License.
@@ -228,7 +228,16 @@ public void afterPropertiesSet() {
228228 @ Override
229229 public Mono <Void > handle (ServerHttpRequest request , ServerHttpResponse response ) {
230230 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+ }
232241 }
233242 ServerWebExchange exchange = createExchange (request , response );
234243
You can’t perform that action at this time.
0 commit comments