LogicGoInfotechSpaces commited on
Commit
3702fa6
·
verified ·
1 Parent(s): fc0b15d

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -3
app.py CHANGED
@@ -174,8 +174,8 @@ async def generate(
174
 
175
 
176
  @app.get("/image/{image_id}")
177
- def get_image(image_id: str, download: Optional[bool] = False, user=Depends(verify_firebase_token)):
178
- """Retrieve stored image by ID (secured by Firebase Auth)."""
179
  try:
180
  oid = ObjectId(image_id)
181
  grid_out = fs.get(oid)
@@ -189,7 +189,12 @@ def get_image(image_id: str, download: Optional[bool] = False, user=Depends(veri
189
  if download:
190
  headers["Content-Disposition"] = f'attachment; filename="{grid_out.filename}"'
191
 
192
- return StreamingResponse(iterfile(), media_type=grid_out.content_type or "application/octet-stream", headers=headers)
 
 
 
 
 
193
 
194
  # ---------------------------------------------------------------------
195
  # Run locally
 
174
 
175
 
176
  @app.get("/image/{image_id}")
177
+ def get_image(image_id: str, download: Optional[bool] = False):
178
+ """Retrieve stored image by ID (no authentication required)."""
179
  try:
180
  oid = ObjectId(image_id)
181
  grid_out = fs.get(oid)
 
189
  if download:
190
  headers["Content-Disposition"] = f'attachment; filename="{grid_out.filename}"'
191
 
192
+ return StreamingResponse(
193
+ iterfile(),
194
+ media_type=grid_out.content_type or "application/octet-stream",
195
+ headers=headers
196
+ )
197
+
198
 
199
  # ---------------------------------------------------------------------
200
  # Run locally