forked from loafle/openapi-generator-original
12319 avoid StringIndexOutOfBoundsException on empty HttpHeaders (#12327)
This commit is contained in:
parent
575b6b4330
commit
1dce6f140c
@ -832,6 +832,9 @@ public class ApiClient{{#jsr310}} extends JavaTimeFormatter{{/jsr310}} {
|
||||
}
|
||||
|
||||
private String headersToString(HttpHeaders headers) {
|
||||
if(headers == null || headers.isEmpty()) {
|
||||
return "";
|
||||
}
|
||||
StringBuilder builder = new StringBuilder();
|
||||
for (Entry<String, List<String>> entry : headers.entrySet()) {
|
||||
builder.append(entry.getKey()).append("=[");
|
||||
|
Loading…
x
Reference in New Issue
Block a user