Auth: Krea-Bilddateien ohne Authentifizierung zugänglich machen
- /api/images/file/{filename} und /api/images/file/{filename}/thumb
als GET ohne Auth erlaubt (analog zu /api/shared/)
This commit is contained in:
1 parent
58468701b9
commit
01b3e2c230
1 file changed
+2
-1
@@ -24,7 +24,8 @@ public class AuthMiddleware
|
|||||||
var isTelegramWebhook = path.StartsWith("/api/telegram/webhook/") && ctx.Request.Method == "POST";
|
var isTelegramWebhook = path.StartsWith("/api/telegram/webhook/") && ctx.Request.Method == "POST";
|
||||||
var isSharedGet = path.StartsWith("/api/shared/") && ctx.Request.Method == "GET";
|
var isSharedGet = path.StartsWith("/api/shared/") && ctx.Request.Method == "GET";
|
||||||
var isAutologin = path == "/api/auth/autologin" && ctx.Request.Method == "GET";
|
var isAutologin = path == "/api/auth/autologin" && ctx.Request.Method == "GET";
|
||||||
if (!path.StartsWith("/api/") || path == "/api/auth/login" || isTelegramWebhook || isSharedGet || isAutologin)
|
var isImageFile = path.StartsWith("/api/images/file/") && ctx.Request.Method == "GET";
|
||||||
|
if (!path.StartsWith("/api/") || path == "/api/auth/login" || isTelegramWebhook || isSharedGet || isAutologin || isImageFile)
|
||||||
{
|
{
|
||||||
await _next(ctx);
|
await _next(ctx);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in new issue
Block a user