Spaces:
Running
Running
Fix: Handle 307 Redirects in Proxy Connection and use direct Vercel URL
Browse files
backend/app/core/config.py
CHANGED
|
@@ -59,7 +59,7 @@ class Settings(BaseSettings):
|
|
| 59 |
TELEGRAM_WEBHOOK_URL: Optional[str] = "https://axeronis-microfunnel-api.hf.space"
|
| 60 |
|
| 61 |
# Telegram Proxy (Vercel) to bypass HF firewall
|
| 62 |
-
TELEGRAM_PROXY_URL: Optional[str] = "https://
|
| 63 |
|
| 64 |
# AI Settings
|
| 65 |
MAX_CONTEXT_MESSAGES: int = 50 # Increased from 30 to 50 for better conversation memory
|
|
|
|
| 59 |
TELEGRAM_WEBHOOK_URL: Optional[str] = "https://axeronis-microfunnel-api.hf.space"
|
| 60 |
|
| 61 |
# Telegram Proxy (Vercel) to bypass HF firewall
|
| 62 |
+
TELEGRAM_PROXY_URL: Optional[str] = "https://microfunnelai.vercel.app/api/proxy/telegram"
|
| 63 |
|
| 64 |
# AI Settings
|
| 65 |
MAX_CONTEXT_MESSAGES: int = 50 # Increased from 30 to 50 for better conversation memory
|
backend/app/services/telegram_service.py
CHANGED
|
@@ -23,7 +23,7 @@ class TelegramService:
|
|
| 23 |
Proxy logic is handled in _get_url, so this just executes the request.
|
| 24 |
"""
|
| 25 |
try:
|
| 26 |
-
async with httpx.AsyncClient(timeout=60.0) as client:
|
| 27 |
if method.lower() == 'get':
|
| 28 |
return await client.get(url, **kwargs)
|
| 29 |
else:
|
|
|
|
| 23 |
Proxy logic is handled in _get_url, so this just executes the request.
|
| 24 |
"""
|
| 25 |
try:
|
| 26 |
+
async with httpx.AsyncClient(timeout=60.0, follow_redirects=True) as client:
|
| 27 |
if method.lower() == 'get':
|
| 28 |
return await client.get(url, **kwargs)
|
| 29 |
else:
|