Conversation
Comment on lines
+100
to
+129
| fastify.get("*", async (request, reply) => { | ||
| const result = execSync(`echo "${decodeURIComponent(request.url.trim())}" | ${envString} ${runtimePath} ${manifestPath}`, { | ||
| cwd: path | ||
| }).toString() | ||
|
|
||
| if (!manifest.contentType || manifest.contentType === 'json' && result) { | ||
| try { | ||
| const resultJson = JSON.parse(result) | ||
|
|
||
| reply | ||
| .header("Content-Type", "application/json") | ||
| .send(resultJson) | ||
| } catch (error) { } | ||
| } else if (manifest.contentType === "html" && result) { | ||
| const body = result | ||
|
|
||
| if (body.startsWith("data:")) { | ||
| const data = body.split(",")[1] | ||
| const contentType = body.split(",")[0].split(":")[1].split(";")[0] | ||
| const base64data = Buffer.from(data, "base64") | ||
| reply.type(contentType).send(base64data) | ||
| } else { | ||
| reply | ||
| .header("Content-Type", "text/html") | ||
| .send(body) | ||
| } | ||
| } else { | ||
| reply.send(result) | ||
| } | ||
| }) |
Check failure
Code scanning / CodeQL
Missing rate limiting
Comment on lines
+87
to
+116
| fastify.get("*", async (request, reply) => { | ||
| const result = execSync(`echo "${decodeURIComponent(request.url.trim())}" | ${envString} ${runtimePath} ${manifestPath}`, { | ||
| cwd: path | ||
| }).toString() | ||
|
|
||
| if (!manifest.contentType || manifest.contentType === 'json' && result) { | ||
| try { | ||
| const resultJson = JSON.parse(result) | ||
|
|
||
| reply | ||
| .header("Content-Type", "application/json") | ||
| .send(resultJson) | ||
| } catch (error) { } | ||
| } else if (manifest.contentType === "html" && result) { | ||
| const body = result | ||
|
|
||
| if (body.startsWith("data:")) { | ||
| const data = body.split(",")[1] | ||
| const contentType = body.split(",")[0].split(":")[1].split(";")[0] | ||
| const base64data = Buffer.from(data, "base64") | ||
| reply.type(contentType).send(base64data) | ||
| } else { | ||
| reply | ||
| .header("Content-Type", "text/html") | ||
| .send(body) | ||
| } | ||
| } else { | ||
| reply.send(result) | ||
| } | ||
| }) |
Check failure
Code scanning / CodeQL
Missing rate limiting
| }) | ||
|
|
||
| fastify.get("*", async (request, reply) => { | ||
| const result = execSync(`echo "${decodeURIComponent(request.url.trim())}" | ${envString} ${runtimePath} ${manifestPath}`, { |
Check warning
Code scanning / CodeQL
Shell command built from environment values
| }) | ||
| } else { | ||
| // pass in stdin to the runtime | ||
| const result = execSync(`echo "${stdinString}" | ${envString} ${runtimePath} ${manifestPath}`, { |
Check warning
Code scanning / CodeQL
Shell command built from environment values
| }) | ||
|
|
||
| fastify.get("*", async (request, reply) => { | ||
| const result = execSync(`echo "${decodeURIComponent(request.url.trim())}" | ${envString} ${runtimePath} ${manifestPath}`, { |
Check warning
Code scanning / CodeQL
Shell command built from environment values
| // Pack files and generate a tempory assembly script | ||
| const { dir } = generateCompileDirectory(source) | ||
|
|
||
| execSync(`npm install && npm run build -- -o ${path.resolve(dest, name)}`, { |
Check warning
Code scanning / CodeQL
Shell command built from environment values
dmikey
approved these changes
Jan 18, 2023
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This commit includes support for blockless sites initialization, build and preview.