mirror of
https://github.com/spring-projects/spring-framework
synced 2026-06-08 17:33:33 +00:00
Handle null header value property
When using an Apache Http components based infrastructure, a null header value is handled as the empty string. The exact same infrastructure using HttpURLConnection generates a header with no colon. This is actually not proper HTTP and some components fail to read such request. We now make sure to call HttpURLConnection#addRequestProperty with the empty String for a null header value. Issue: SPR-13225
This commit is contained in:
+2
-1
@@ -100,7 +100,8 @@ final class SimpleBufferingClientHttpRequest extends AbstractBufferingClientHttp
|
||||
}
|
||||
else {
|
||||
for (String headerValue : entry.getValue()) {
|
||||
connection.addRequestProperty(headerName, headerValue);
|
||||
String actualHeaderValue = headerValue != null ? headerValue : "";
|
||||
connection.addRequestProperty(headerName, actualHeaderValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user