From ed14a0029abd62e8cee8b017227200a8ddcaa6c8 Mon Sep 17 00:00:00 2001 From: gtoxlili <664037691@qq.com> Date: Wed, 24 May 2023 21:08:32 +0800 Subject: [PATCH 1/3] fix : issues #1732 --- app/utils/format.ts | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/app/utils/format.ts b/app/utils/format.ts index d2912d20b..6c205c360 100644 --- a/app/utils/format.ts +++ b/app/utils/format.ts @@ -1,7 +1,10 @@ export function prettyObject(msg: any) { + const obj = msg; if (typeof msg !== "string") { msg = JSON.stringify(msg, null, " "); } - const prettyMsg = ["```json", msg, "```"].join("\n"); - return prettyMsg; + if (msg === "{}") { + return obj.toString(); + } + return ["```json", msg, "```"].join("\n"); } From 707c1a2f7ed218384b71093c82eba95615fe7b07 Mon Sep 17 00:00:00 2001 From: gtoxlili <664037691@qq.com> Date: Wed, 24 May 2023 21:18:51 +0800 Subject: [PATCH 2/3] fix : specify the default hostname if docker builds with a proxy --- Dockerfile | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Dockerfile b/Dockerfile index 21adff9bb..eb6fa0e96 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,6 +41,9 @@ COPY --from=builder /app/.next/server ./.next/server EXPOSE 3000 CMD if [ -n "$PROXY_URL" ]; then \ + if [ -z "$HOSTNAME" ]; then + HOSTNAME="127.0.0.1" + fi; \ protocol=$(echo $PROXY_URL | cut -d: -f1); \ host=$(echo $PROXY_URL | cut -d/ -f3 | cut -d: -f1); \ port=$(echo $PROXY_URL | cut -d: -f3); \ From aa2be9b96c165d6bde30f5a02fadfe93cc79df5b Mon Sep 17 00:00:00 2001 From: gtoxlili <664037691@qq.com> Date: Wed, 24 May 2023 21:40:53 +0800 Subject: [PATCH 3/3] fix : specify the default hostname if docker builds with a proxy --- Dockerfile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Dockerfile b/Dockerfile index eb6fa0e96..6ca7a59bb 100644 --- a/Dockerfile +++ b/Dockerfile @@ -41,8 +41,8 @@ COPY --from=builder /app/.next/server ./.next/server EXPOSE 3000 CMD if [ -n "$PROXY_URL" ]; then \ - if [ -z "$HOSTNAME" ]; then - HOSTNAME="127.0.0.1" + if [ -z "$HOSTNAME" ]; then \ + export HOSTNAME="127.0.0.1" \ fi; \ protocol=$(echo $PROXY_URL | cut -d: -f1); \ host=$(echo $PROXY_URL | cut -d/ -f3 | cut -d: -f1); \