diff --git a/src/main/java/au/com/royalpay/payment/manage/shopify/support/ShopifyHttpUtils.java b/src/main/java/au/com/royalpay/payment/manage/shopify/support/ShopifyHttpUtils.java index c73bf2dec..894fc161d 100644 --- a/src/main/java/au/com/royalpay/payment/manage/shopify/support/ShopifyHttpUtils.java +++ b/src/main/java/au/com/royalpay/payment/manage/shopify/support/ShopifyHttpUtils.java @@ -2,22 +2,18 @@ package au.com.royalpay.payment.manage.shopify.support; import org.slf4j.Logger; import org.slf4j.LoggerFactory; -import org.springframework.web.util.ContentCachingRequestWrapper; import javax.servlet.http.HttpServletRequest; import java.io.BufferedReader; import java.io.IOException; -import java.nio.charset.StandardCharsets; public class ShopifyHttpUtils { - private ShopifyHttpUtils(){} + private ShopifyHttpUtils() { + } + private static final Logger logger = LoggerFactory.getLogger(ShopifyHttpUtils.class); public static String getRequestBody(HttpServletRequest request) { - if (request instanceof ContentCachingRequestWrapper) { - logger.info("Shopify Request Cached, read directly"); - return new String(((ContentCachingRequestWrapper) request).getContentAsByteArray(), StandardCharsets.UTF_8); - } BufferedReader br = null; StringBuilder sb = new StringBuilder(""); try { @@ -39,6 +35,8 @@ public class ShopifyHttpUtils { } } } - return sb.toString(); + String body = sb.toString(); + logger.debug("Shopify read body |-{}", body); + return body; } }