We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2dd7218 commit d950d21Copy full SHA for d950d21
backend/src/api/photos/PhotosController.ts
@@ -195,6 +195,16 @@ export class PhotosController extends Controller {
195
@Path() identifier: string,
196
@Request() req: express.Request
197
): Promise<void> {
198
+ // Ensure this is a valid photo identifier so they can't get arbitrary s3 objects
199
+ const photoRepo = getRepository(Photo);
200
+ const photoExists = await photoRepo.exists({
201
+ where: { identifier: identifier },
202
+ });
203
+
204
+ if (!photoExists) {
205
+ throw new NotFound();
206
+ }
207
208
const command = new GetObjectCommand({
209
Bucket: 'fourties-photos',
210
Key: `jpg/${identifier}.jpg`,
0 commit comments