Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions apps/client/src/shared/utils/fetchOgData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,19 +70,19 @@ export function parseOgData(html: string, sourceUrl: string): OGData {
* - extractHtml: 프록시 응답에서 순수 HTML을 추출하는 함수
*/
const proxyServices = [
{
name: 'CORSProxy.io',
buildUrl: (targetUrl: string) =>
`https://corsproxy.io/?${encodeURIComponent(targetUrl)}`,
extractHtml: (response: AxiosResponse) => response.data,
},
// TODO: 2개까지 보낼 필요 없어서 일단 주석처리
// {
// name: 'AllOrigins',
// name: 'CORSProxy.io',
// buildUrl: (targetUrl: string) =>
// `https://api.allorigins.win/get?url=${encodeURIComponent(targetUrl)}`,
// extractHtml: (response: AxiosResponse) => response.data?.contents,
// `https://corsproxy.io/?${encodeURIComponent(targetUrl)}`,
// extractHtml: (response: AxiosResponse) => response.data,
// },
// TODO: 2개까지 보낼 필요 없어서 일단 주석처리
{
name: 'AllOrigins',
buildUrl: (targetUrl: string) =>
`https://api.allorigins.win/get?url=${encodeURIComponent(targetUrl)}`,
extractHtml: (response: AxiosResponse) => response.data?.contents,
},
Comment on lines 73 to +85
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟡 Minor

🧩 Analysis chain

🏁 Script executed:

cd /tmp && find . -name "fetchOgData.ts" -type f 2>/dev/null | head -20

Repository: Pinback-Team/pinback-client

Length of output: 53


🏁 Script executed:

git ls-files | grep -i fetchogdata

Repository: Pinback-Team/pinback-client

Length of output: 114


🏁 Script executed:

find . -path "*/client/src/shared/utils/fetchOgData.ts" -type f

Repository: Pinback-Team/pinback-client

Length of output: 116


🏁 Script executed:

fd "fetchOgData.ts"

Repository: Pinback-Team/pinback-client

Length of output: 114


🏁 Script executed:

cat -n apps/client/src/shared/utils/fetchOgData.ts 2>/dev/null || find . -name "fetchOgData.ts" -exec cat -n {} \;

Repository: Pinback-Team/pinback-client

Length of output: 4395


🏁 Script executed:

#!/bin/bash
# Test AllOrigins API with a simple example URL
TEST_URL="https://example.com"
echo "Testing AllOrigins API response structure..."
curl -s "https://api.allorigins.win/get?url=${TEST_URL}" | head -c 1000
echo -e "\n---\nChecking response fields..."
curl -s "https://api.allorigins.win/get?url=${TEST_URL}" | jq 'keys' 2>/dev/null || echo "jq parsing failed or service unavailable"

Repository: Pinback-Team/pinback-client

Length of output: 839


AllOrigins API 검증 완료 - JSDoc 수정 필요

AllOrigins API(api.allorigins.win)는 정상적으로 작동하며, 응답 형식이 예상대로 contents 필드를 포함하고 있습니다. 코드의 response.data?.contents 추출 로직이 정확합니다.

다만 88-91줄의 JSDoc 주석이 이제 정확하지 않습니다. 현재는 AllOrigins 하나만 활성화되어 있으므로 "여러 CORS 프록시를 동시에 시도"라는 설명을 "CORS 프록시를 통해 OG 데이터를 가져옵니다" 등으로 수정하세요.

🤖 Prompt for AI Agents
In `@apps/client/src/shared/utils/fetchOgData.ts` around lines 73 - 85, The JSDoc
above the CORS proxy configurations is outdated because only the AllOrigins
entry (name: 'AllOrigins', buildUrl, extractHtml) remains active; update the
JSDoc text (around the comment block that used to describe trying multiple CORS
proxies) to a concise description like "Fetches OG data via a CORS proxy
(AllOrigins)" or "CORS 프록시를 통해 OG 데이터를 가져옵니다", and remove the part that says it
will try multiple proxies simultaneously so the comment accurately reflects the
current AllOrigins implementation.

];

/**
Expand Down
Loading