fix poem image - #1006
fix poem image#1006Tech-lo wants to merge 13 commits into
Conversation
|
| return Response( | ||
| content=image_bytes, | ||
| media_type=media_type, | ||
| headers={"Cache-Control": "public, max-age=86400"}, |
There was a problem hiding this comment.
When a poem image is temporarily unavailable, the neutral fallback receives the same 24-hour public cache policy as a successful image, causing caches and crawlers to keep showing the fallback after the poem image becomes available again.
Prompt To Fix With AI
This is a comment left during a code review.
Path: pecha_api/share/share_service.py
Line: 108
Comment:
**Fallback image remains cached**
When a poem image is temporarily unavailable, the neutral fallback receives the same 24-hour public cache policy as a successful image, causing caches and crawlers to keep showing the fallback after the poem image becomes available again.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.| if share_request.poem_id is None: | ||
| share_request.poem_id = _extract_poem_id_from_url_(share_request.url) |
There was a problem hiding this comment.
Poem ID overrides shared resource
When a share request supplies a poem_id that differs from the poem in its URL or accompanies a segment/text URL, this branch preserves that ID, skips segment/text image generation, and builds the preview from the supplied poem, causing crawlers to display an image that does not represent the shared resource.
Prompt To Fix With AI
This is a comment left during a code review.
Path: pecha_api/share/share_service.py
Line: 181-182
Comment:
**Poem ID overrides shared resource**
When a share request supplies a `poem_id` that differs from the poem in its URL or accompanies a segment/text URL, this branch preserves that ID, skips segment/text image generation, and builds the preview from the supplied poem, causing crawlers to display an image that does not represent the shared resource.
---
For each issue above, determine whether it is valid and should be fixed. If so, fix it directly.
|



Webuddhist-tech/WeBuddhist-app#741