Compare commits
1 Commits
alert-auto
...
alert-auto
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
10e689fdce |
@@ -499,7 +499,7 @@ Generate the complete JSON with all 30 fields personalized for {website_url}:
|
||||
# Log context summary for debugging
|
||||
logger.info("AIStructuredAutofillService: context summary | user=%s", user_id)
|
||||
logger.info(" - Website analysis exists: %s", bool(context_summary.get('user_profile', {}).get('website_url')))
|
||||
logger.info(" - Research config: %s", context_summary.get('research_config', {}).get('research_depth', 'None'))
|
||||
logger.info(" - Research config present: %s", bool(context_summary.get('research_config', {}).get('research_depth')))
|
||||
logger.info(" - API capabilities: %s", len(context_summary.get('api_capabilities', {}).get('providers', [])))
|
||||
logger.info(" - Content analysis: %s", bool(context_summary.get('content_analysis')))
|
||||
logger.info(" - Audience insights: %s", bool(context_summary.get('audience_insights')))
|
||||
|
||||
@@ -1048,21 +1048,12 @@ async def serve_image_studio_image(
|
||||
raise HTTPException(status_code=403, detail="Access denied: image not found in your library")
|
||||
|
||||
# Determine if it's an edited image or regular image
|
||||
# Validate user-controlled path input before filesystem path construction
|
||||
image_filename_path = Path(image_filename)
|
||||
if image_filename_path.is_absolute() or any(part in ("", ".", "..") for part in image_filename_path.parts):
|
||||
raise HTTPException(status_code=403, detail="Access denied: Invalid image path")
|
||||
|
||||
base_dir = Path(__file__).parent.parent
|
||||
image_studio_dir = (base_dir / "image_studio_images").resolve()
|
||||
|
||||
if image_filename.startswith("edited/"):
|
||||
# Remove "edited/" prefix and serve from edited directory
|
||||
actual_filename = image_filename.replace("edited/", "", 1)
|
||||
actual_filename_path = Path(actual_filename)
|
||||
if actual_filename_path.is_absolute() or any(part in ("", ".", "..") for part in actual_filename_path.parts):
|
||||
raise HTTPException(status_code=403, detail="Access denied: Invalid image path")
|
||||
|
||||
image_path = (image_studio_dir / "edited" / actual_filename).resolve()
|
||||
base_subdir = (image_studio_dir / "edited").resolve()
|
||||
else:
|
||||
|
||||
Reference in New Issue
Block a user