Skip to content

Commit

Permalink
Lukke entity for request også
Browse files Browse the repository at this point in the history
  • Loading branch information
zapodot committed Oct 3, 2023
1 parent da29f23 commit 12fa806
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/main/java/no/ks/fiks/io/klient/FiksIOUtsendingKlient.java
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,10 @@ public static FiksIOUtsendingKlientBuilder builder() {
}

public SendtMeldingApiModel send(@NonNull MeldingSpesifikasjonApiModel metadata, @NonNull Optional<InputStream> data) {
final ClassicHttpRequest request = requestFactory.createSendToFiksIORequest(createMultiPartContent(metadata, data));
authenticationStrategy.setAuthenticationHeaders(request);
requestInterceptor.apply(request);

try {
try (final HttpEntity httpEntity = createMultiPartContent(metadata, data)) {
final ClassicHttpRequest request = requestFactory.createSendToFiksIORequest(httpEntity);
authenticationStrategy.setAuthenticationHeaders(request);
requestInterceptor.apply(request);
return client.execute(request, response -> {
final int responseCode = response.getCode();
log.debug("Response status: {}", responseCode);
Expand Down

0 comments on commit 12fa806

Please sign in to comment.