File tree Expand file tree Collapse file tree 1 file changed +12
-5
lines changed
modules/openapi-generator/src/main/resources/Java/libraries/native Expand file tree Collapse file tree 1 file changed +12
-5
lines changed Original file line number Diff line number Diff line change @@ -53,6 +53,17 @@ import java.util.function.Consumer;
5353import java.util.concurrent.CompletableFuture;
5454{ {/asyncNative} }
5555
56+ static class HttpRequestBuilderExtensions {
57+ static HttpRequest.Builder withAdditionalHeaders(HttpRequest.Builder builder, Map< String, String> headers) {
58+ if (headers != null) {
59+ for (Map.Entry< String, String> entry : headers.entrySet()) {
60+ builder.header(entry.getKey(), entry.getValue());
61+ }
62+ }
63+ return builder;
64+ }
65+ }
66+
5667{ {> generatedAnnotation} }
5768{ {#operations} }
5869public class { {classname} } {
@@ -677,11 +688,7 @@ public class {{classname}} {
677688 localVarRequestBuilder.timeout(memberVarReadTimeout);
678689 }
679690 // Add custom headers if provided
680- if (headers != null) {
681- for (Map.Entry< String, String> entry : headers.entrySet()) {
682- localVarRequestBuilder.header(entry.getKey(), entry.getValue());
683- }
684- }
691+ localVarRequestBuilder = HttpRequestBuilderExtensions.withAdditionalHeaders(localVarRequestBuilder, headers);
685692 if (memberVarInterceptor != null) {
686693 memberVarInterceptor.accept(localVarRequestBuilder);
687694 }
You can’t perform that action at this time.
0 commit comments