diff --git a/media-backend-api-client/src/main/java/nl/vpro/api/client/media/ContentTypeInterceptor.java b/media-backend-api-client/src/main/java/nl/vpro/api/client/media/ContentTypeInterceptor.java index a07eca2c..0e5ec3c9 100644 --- a/media-backend-api-client/src/main/java/nl/vpro/api/client/media/ContentTypeInterceptor.java +++ b/media-backend-api-client/src/main/java/nl/vpro/api/client/media/ContentTypeInterceptor.java @@ -26,8 +26,8 @@ public void aroundWriteTo(WriterInterceptorContext context) throws IOException, if (CONTENT_TYPE.get() != null) { try { context.getHeaders().put(HttpHeaders.CONTENT_TYPE, Collections.singletonList(CONTENT_TYPE.get())); - if (context.getEntity() instanceof InputStream) { - IOUtils.copy((InputStream) context.getEntity(), context.getOutputStream()); + if (context.getEntity() instanceof InputStream inputStream) { + IOUtils.copy(inputStream, context.getOutputStream()); } else { context.proceed(); }