From fe7419cd28149ce61abe8e936e873c0eca15df0e Mon Sep 17 00:00:00 2001 From: lu4p Date: Mon, 3 Jan 2022 20:21:06 +0100 Subject: [PATCH] Fix custom provider with empty prefix Before when a CustomProvider("", "") was used, the resulting app.js would try to fetch //web/app.wasm instead of /web/app.wasm, which is the same as https://web/app.wasm only ignoring the protocol. --- pkg/app/resource.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg/app/resource.go b/pkg/app/resource.go index 4c62476e0..d00da791f 100644 --- a/pkg/app/resource.go +++ b/pkg/app/resource.go @@ -2,6 +2,7 @@ package app import ( "net/http" + "path/filepath" "strings" ) @@ -101,7 +102,7 @@ func CustomProvider(path, prefix string) ResourceProvider { return localDir{ Handler: http.FileServer(http.Dir(root)), root: prefix, - appWASM: prefix + "/web/app.wasm", + appWASM: filepath.Join(prefix, "web/app.wasm"), } }