forgot to decode static path

This commit is contained in:
William Bell committed 2024-06-17 15:20:32 +01:00
1 parent de50e29d87
commit 0095015d7d
4 files changed
+5 -4

No files matched your search

+1 -1
View File
@@ -1,4 +1,4 @@
{
"name": "http.ar",
"version": "1.1.5"
"version": "1.1.6"
}
+1 -1
View File
@@ -1 +1 @@
[{"Name":"neon.ar","Version":"beta1.0.2","URL":"https://isotope.wbell.dev/isotope-download?name=neon.ar\u0026version=beta1.0.2","Remote":"isotope.wbell.dev"},{"Name":"url.ar","Version":"1.0.2","URL":"https://isotope.wbell.dev/isotope-download?name=url.ar\u0026version=1.0.2","Remote":"isotope.wbell.dev"}]
[{"Name":"neon.ar","Version":"beta1.0.2","URL":"https://isotope.wbell.dev/isotope-download?version=beta1.0.2\u0026name=neon.ar","Remote":"isotope.wbell.dev"},{"Name":"url.ar","Version":"1.0.2","URL":"https://isotope.wbell.dev/isotope-download?name=url.ar\u0026version=1.0.2","Remote":"isotope.wbell.dev"}]
+2 -1
View File
@@ -1,11 +1,12 @@
import "handleRequest" as handleRequest
import "url.ar" as url
let static(root, path) = do
if (root == "/") root = ""
let middleware(req, res) = do
if (req.method != "GET") return res.next()
if (not req.path.startswith(root)) return res.next()
let reqPath = req.path[root.length:]
let reqPath = url.decode(req.path[root.length:])
let pathsToTry = [path+reqPath, path+reqPath+"/index.html"]
for (i from 0 to pathsToTry.length) do
try do
+1 -1
View File
@@ -1 +1 @@
let version = "1.0.0"
let version = "1.1.6"