fixes based on comment (missing api compatability and translation keys)

This commit is contained in:
Marek Maslowski
2026-04-04 20:30:21 +02:00
parent 554a7d7530
commit 20709d23ee
4 changed files with 71 additions and 33 deletions
@@ -2,6 +2,7 @@ import { Readable } from 'node:stream';
import { pipeline } from 'node:stream/promises';
import { Response } from 'express';
import { canAccessTrip, db } from "../../db/database";
import { checkSsrf } from '../../utils/ssrfGuard';
// helpers for handling return types
@@ -163,6 +164,13 @@ export function updateSyncTimeForAlbumLink(linkId: string): void {
export async function pipeAsset(url: string, response: Response): Promise<void> {
try{
const SsrfResult = await checkSsrf(url);
if (!SsrfResult.allowed) {
response.status(400).json({ error: SsrfResult.error });
response.end();
return;
}
const resp = await fetch(url);
response.status(resp.status);