Browse Source

fix(asset-server-plugin): Do not return raw error message on error

https://github.com/vendure-ecommerce/vendure/security/code-scanning/15
Michael Bromley 1 year ago
parent
commit
801980e8f5
1 changed files with 2 additions and 2 deletions
  1. 2 2
      packages/asset-server-plugin/src/plugin.ts

+ 2 - 2
packages/asset-server-plugin/src/plugin.ts

@@ -310,8 +310,8 @@ export class AssetServerPlugin implements NestModule, OnApplicationBootstrap {
                         res.send(imageBuffer);
                         res.send(imageBuffer);
                         return;
                         return;
                     } catch (e: any) {
                     } catch (e: any) {
-                        Logger.error(e, loggerCtx, e.stack);
-                        res.status(500).send(e.message);
+                        Logger.error(e.message, loggerCtx, e.stack);
+                        res.status(500).send('An error occurred when generating the image');
                         return;
                         return;
                     }
                     }
                 }
                 }