Skip to content

Commit

Permalink
Stability enhancements for web examples
Browse files Browse the repository at this point in the history
  • Loading branch information
glyph-cat committed May 7, 2024
1 parent 2f1d96d commit 41d6ec5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/examples-web/src/pages/api/open-in-editor/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,10 @@ export default async function APICancelSwapTicketHandler(
// If 'code' is not found,
// 1. Press ctrl/command-shift-P
// 2. Search and run "Shell Command: Install 'code' command in PATH"
execSync(`code ${`${process.cwd()}/src/pages${path}.${fileExtension}`}`)
const constructedPath = `${process.cwd()}/src/pages${path}.${fileExtension}`
execSync(`code "${JSON.stringify(constructedPath)}"`)
// KIV: js/shell-command-injection-from-environment
// This is meant to be run temporarily in localhost only so it should be fine,
// but let's keep an eye on this issue just in case.
res.status(200).send(null)
}

0 comments on commit 41d6ec5

Please sign in to comment.