From 9c42322438378ee40526ea6c0f29b8dbff693d72 Mon Sep 17 00:00:00 2001 From: Yixian Date: Thu, 7 Apr 2022 17:55:24 +0800 Subject: [PATCH] shopify hmac optimise --- .../payment/manage/shopify/support/ShopifyHttpUtils.java | 5 +++++ 1 file changed, 5 insertions(+) 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 cd3c64d8f..c73bf2dec 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 @@ -1,5 +1,7 @@ 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; @@ -8,9 +10,12 @@ import java.io.IOException; import java.nio.charset.StandardCharsets; public class 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;