og:image 의 http 주소를 버리지 않고 https 로 올린다 - #49
Merged
Merged
Conversation
- prod 에서 postarchivefaction 상품이 이미지만 빠진 INCOMPLETE 로 떨어졌는데, og:image 가 HTML 에 있었다. 못 찾은 게 아니라 normalizeImageUrl 이 https 로 시작하지 않는다는 이유로 조용히 버린 것이었다 - 같은 주소가 https 로는 200 image/jpeg 로 정상이다(실측, http 는 301 로 https 에 넘긴다). 사이트가 og:image 에 http 를 적어뒀을 뿐 이미지는 멀쩡했다 - 값이 처음부터 있었는데 버려진 탓에 승격 체인이 통째로 헛돌았다: LLM 86k 토큰 -> 브라우저 렌더 3.3초 -> LLM 11k 토큰 -> 같은 http 값을 또 버림 -> INCOMPLETE - http 그대로 저장하는 선택지는 없다. 클라이언트가 https 라 브라우저가 mixed content 로 막아 저장해도 안 보인다. 승격이 실패하면 이미지가 안 뜨는데, 버리면 애초에 없으므로 더 나빠지지 않는다 - 프로토콜 상대(//host/path)도 같은 성격이라 함께 살린다. 스킴만 없을 뿐 멀쩡한 주소다 - javascript:·data:·file: 은 그대로 거부한다. 가드가 원래 막으려던 것이 이쪽이고, 스킴을 갈아끼워 살릴 수 있는 값도 아니다. 뭉툭했던 건 위험한 값과 고쳐 쓸 수 있는 값을 한 덩어리로 취급한 것이었다
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
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.
Situation
INCOMPLETE로 떨어졌다(item.parse.result item=1967 result=incomplete missing=imageUrl).og:image는 HTML 에 있었다. 못 찾은 게 아니라normalizeImageUrl이https://로 시작하지 않는다는 이유로 조용히 버린 것이었다.http://...https://...image/jpeg1.1MBTask
Action
https://host/a.jpghttp://host/a.jpghttps://host/a.jpg로 승격//host/a.jpg(프로토콜 상대)https://host/a.jpg로 승격javascript:·data:·file:가드 자체는 맞았다.
<img src>로 흘러가는 값이라javascript:같은 걸 막아야 한다. 뭉툭했던 게 문제다 — 위험한 값과 스킴만 올리면 되는 값을 한 덩어리로 취급했다.http 를 그대로 저장하지 않는 이유
선택지가 아니다. 클라이언트가 https 라 브라우저가 mixed content 로 막아 저장해도 안 보인다.
승격이 실패할 위험은 있지만 손해가 없다. 올린 주소가 안 되면 이미지가 안 뜨는데, 버리면 애초에 이미지가 없다. 더 나빠질 수 없는 교환이다.
Result
INCOMPLETE4건 중 2건이missing=imageUrl이다. 컨테이너 로그 보존 범위 안의 숫자라 전체 규모는 아니고, Shopify 계열이og:image에 http 를 적는 경우가 있어 이 몰 하나의 문제가 아닐 수 있다.남은 것
/cdn/shop/a.jpg)는 여전히 버린다. 살리려면 페이지 URL 로 해석해야 하는데(fromExtracted가link를 이미 받으므로 가능하다) 이번 범위 밖으로 뒀다.연관 이슈