게시글 공유 — 셸 서빙 폐기, 사람만 웹앱으로 302#131
Merged
Merged
Conversation
셸 서빙(#130)은 브라우저에서 앱이 시작하자마자 죽었다. 교차 출처 <base href> 로는 Flutter 라우터의 history.replaceState 가 SecurityError 로 막히고(서비스워커 등록도 동일), flutter.js 에는 에셋 기준을 base href 와 분리하는 설정이 없어 우회 불가다. 프로덕션은 시크릿 해제로 즉시 롤백했고, 이제 UA 분기 302 로 간다. · 크롤러 → 지금까지의 서버 렌더링 HTML(OG 태그) → 링크 미리보기 유지 · 사람 → WEB_APP_URL/p/<postId> 로 302 (cache-control: no-store) · WEB_APP_URL 미설정 → 전부 서버 렌더링(스위치는 그대로)⚠️ 인앱 브라우저를 크롤러로 오인하면 안 된다. 카카오톡은 스크래퍼가 kakaotalk-scrap/1.0, 인앱 브라우저(사람)가 "… KAKAOTALK 10.x.x" 다. kakaotalk 로 뭉뚱그리면 한국에서 이 링크를 여는 가장 흔한 경로가 전부 서버 렌더링에 갇힌다. 네이버(앱 NAVER / 크롤러 Yeti)·다음(앱 Daum / 크롤러 daumoa)도 같다. 판정 오류의 손해가 비대칭이라(사람→크롤러 오인은 무해, 크롤러→사람 오인은 미리보기 사망) 일반 봇 토큰(bot/crawler/spider/scraper)도 넓게 받는다. 검증(프로덕션): 일반 브라우저 UA → 302, 카톡 인앱 브라우저 UA → 302, kakaotalk-scrap → og:title 포함 HTML. deno check 통과. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
#130 의 셸 서빙을 폐기하고 UA 분기 302 로 바꾼다. 이미 프로덕션에 배포·검증했다.
왜 셸 서빙이 안 됐나
go.pawmate.kr/s에서 웹앱index.html을<base href>만 웹앱 절대주소로 바꿔 내려주는 방법이었다. 셸·OG·pm-post주입까지 전부 정상이었는데 브라우저에서 앱이 시작하자마자 죽었다.Flutter 라우터가 히스토리를 조작할 때 교차 출처 base 를 브라우저가 막는다(서비스워커 등록도 같은 이유로 실패).
flutter.js에는 에셋 기준(assetBase)을 base href 와 분리하는 설정이 없어(모두document.baseURI기준) 우회할 수 없다. 같은 주소를 유지하려면 Worker 가 앱 전체를 동일 출처로 프록시해야 하는데 비용 대비 이득이 작다.프로덕션은 시크릿 해제로 즉시 롤백했고 서버 렌더링 정상 복귀를 확인했다.
대신 하는 것
WEB_APP_URL/p/<postId>로 302 (cache-control: no-store)WEB_APP_URL미설정인앱 브라우저를 크롤러로 오인하면 안 된다.
kakaotalk-scrap/1.0… KAKAOTALK 10.x.xkakaotalk로 뭉뚱그리면 한국에서 이 링크를 여는 가장 흔한 경로가 전부 서버 렌더링에 갇힌다. 네이버(앱NAVER/ 크롤러Yeti)·다음(앱Daum/ 크롤러daumoa)도 같다.판정 오류의 손해가 비대칭이다 — 사람을 크롤러로 오인하면 기존 페이지를 볼 뿐(무해)이지만, 크롤러를 사람으로 오인하면 미리보기가 죽는다. 그래서 끝에 일반 봇 토큰(
bot/crawler/spider/scraper)도 넓게 받는다.검증 (프로덕션 실측)
302 → app.pawmate.kr/p/32da10f4-…✅302✅ (사람으로 정확히 판정)kakaotalk-scrap/1.0og:title포함 HTML ✅브라우저에서도 실제로 리다이렉트 후 앱이 로드되는 것을 확인했다.
deno check통과.🤖 Generated with Claude Code