mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-22 22:48:04 +02:00
fix(proxy): remove auth requirement to allow browser image requests, keep ssrf protection
This commit is contained in:
1 parent
38572fa747
commit
842862006a
1 file changed
+3
-11
@@ -51,22 +51,14 @@ class ProxyHandler {
|
|||||||
final path = request.url.path;
|
final path = request.url.path;
|
||||||
|
|
||||||
// Only handle /api/xtream/* requests
|
// Only handle /api/xtream/* requests
|
||||||
// CRITICAL: Check path BEFORE auth so non-proxy requests fall through to static handler
|
// CRITICAL: Check path BEFORE anything else so non-proxy requests fall through to static handler
|
||||||
if (!path.startsWith('api/xtream/')) {
|
if (!path.startsWith('api/xtream/')) {
|
||||||
// Return 404 so Cascade tries next handler (staticHandler)
|
// Return 404 so Cascade tries next handler (staticHandler)
|
||||||
return Response.notFound('Not an xtream proxy request');
|
return Response.notFound('Not an xtream proxy request');
|
||||||
}
|
}
|
||||||
|
|
||||||
// === AUTHENTICATION (applied only for /api/xtream/* requests) ===
|
// NOTE: Authentication REMOVED from proxy to allow browser-initiated requests (img src, etc.)
|
||||||
final token = _extractToken(request);
|
// SSRF protection is still active via domain validation below.
|
||||||
if (token == null) {
|
|
||||||
return Response(401, body: 'Unauthorized');
|
|
||||||
}
|
|
||||||
|
|
||||||
final session = _db.findSessionByToken(token);
|
|
||||||
if (session == null) {
|
|
||||||
return Response(401, body: 'Invalid or expired session');
|
|
||||||
}
|
|
||||||
|
|
||||||
// === PROXY LOGIC ===
|
// === PROXY LOGIC ===
|
||||||
try {
|
try {
|
||||||
|
|||||||
Reference in new issue
Block a user