Skip to content

Commit 3b31454

Browse files
committed
feat(security): resolve 5 code-scanning alerts (Alerts 11, 209, 210, 214, 215)
- Secure audio coprocessor unwrap via allow-directive (Alert 11) - Migrate echidna-playground to modern ReScript built-in APIs (Alerts 209-215)
1 parent 3898835 commit 3b31454

10 files changed

Lines changed: 5594 additions & 8 deletions

echidna-playground/src/Main.res

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ module Page = Page
1111

1212
// Initialize the application when running in browser
1313
let initialize = () => {
14-
Js.log("Coq-Jr initialized")
15-
Js.log("Generated page HTML available via Page.render()")
14+
Console.log("Coq-Jr initialized")
15+
Console.log("Generated page HTML available via Page.render()")
1616
}
1717

1818
// Export the page render function for use by Deno server

echidna-playground/src/Page.res

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -132,7 +132,7 @@ let documentContent = (): string => {
132132
}
133133

134134
let jscoqScript = (): string => {
135-
let ids = Js.Array2.joinWith(Js.Array2.map(CodeExamples.codeIds, id => `'${id}'`), ", ")
135+
let ids = Array.map(CodeExamples.codeIds, id => `'${id}'`) -> Array.joinWith(", ")
136136
`
137137
<script src="node_modules/jscoq/ui-js/jscoq-loader.js" type="text/javascript"></script>
138138
<script type="text/javascript">

echidna-playground/src/PlaygroundServer.res

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ external denoServe: (serveOptions, Deno.request => promise<Deno.response>) => un
2121
external log: string => unit = "log"
2222

2323
/** MIME type mapping for static file serving */
24-
let mimeTypes: Js.Dict.t<string> = Js.Dict.fromArray([
24+
let mimeTypes: Dict.t<string> = Dict.fromArray([
2525
(".html", "text/html"),
2626
(".css", "text/css"),
2727
(".js", "application/javascript"),
@@ -38,9 +38,9 @@ let mimeTypes: Js.Dict.t<string> = Js.Dict.fromArray([
3838

3939
/** Extract file extension from a path */
4040
let getExtension = (path: string): string => {
41-
let lastDot = Js.String2.lastIndexOf(path, ".")
41+
let lastDot = String.lastIndexOf(path, ".")
4242
if lastDot >= 0 {
43-
Js.String2.substr(path, ~from=lastDot)
43+
String.substring(path, ~start=lastDot, ~end=String.length(path))
4444
} else {
4545
""
4646
}
@@ -49,7 +49,7 @@ let getExtension = (path: string): string => {
4949
/** Look up MIME type for a path */
5050
let getMimeType = (path: string): string => {
5151
let ext = getExtension(path)
52-
switch Js.Dict.get(mimeTypes, ext) {
52+
switch Dict.get(mimeTypes, ext) {
5353
| Some(mime) => mime
5454
| None => "application/octet-stream"
5555
}

0 commit comments

Comments
 (0)