From 3f2dcbfe36a3236d77d58821fd7c9988155a2c6e Mon Sep 17 00:00:00 2001 From: Gyubin-Han Date: Mon, 30 Jun 2025 17:54:10 +0900 Subject: [PATCH] =?UTF-8?q?Fix:=20=EC=9B=90=EB=B3=B8=20URL=EC=9D=98=20?= =?UTF-8?q?=EC=A0=84=EC=86=A1=20=EB=B0=A9=EB=B2=95=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 원본 URL 내 URL에서 사용되는 특수 문자가 있는 경우, 전송될 때, 본 요청 URL에 포함 처리되는 문제로 인해, 원본 URL 값이 손상되는 문제 발견 및 수정 기존 : URL 파라미터의 원본 URL 값을 대입하여 전송 수정 : Request Body에 원본 URL 값을 대입하여 전송 --- src/main/resources/templates/index.html | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index cedf0e7..7054e8d 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -143,9 +143,13 @@ } // 단축 URL 생성 요청 및 처리 - var queryUrl="/short?url="+inputUrl; + var queryUrl="/short" fetch(queryUrl,{ - method: "POST" + method: "POST", + headers:{ + "Content-Type": "application/json" + }, + body: JSON.stringify({ originalUrl : inputUrl }) }) .then(response => { if(!response.ok){