File tree 1 file changed +5
-2
lines changed
grails-app/services/au/org/ala/ecodata/forms
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -618,7 +618,7 @@ class EcpWebService {
618
618
619
619
ResponseBody responseBody = response. body()
620
620
okhttp3.MediaType respContentType = responseBody. contentType()
621
- String mediaType = respContentType. type ()?. toLowerCase()
621
+ String mediaType = respContentType. toString ()?. toLowerCase()
622
622
def responseData
623
623
if (isTextBased(mediaType)) {
624
624
responseData = responseBody. string()
@@ -627,7 +627,10 @@ class EcpWebService {
627
627
responseData = objectMapper. readValue(responseData, Object )
628
628
}
629
629
} else {
630
- responseData = responseBody. byteStream()
630
+ // This is only used for the /document/createThumbnail endpoint. Because the thumbnail is small we
631
+ // can get away with reading the entire response into memory. If dealing with large files
632
+ // we might have to remove the try with resources and handle the stream manually.
633
+ responseData = responseBody. bytes()
631
634
}
632
635
633
636
result. statusCode = result. status = response. code()
You can’t perform that action at this time.
0 commit comments