mirror of
https://github.com/1f349/lavender.git
synced 2024-12-22 07:34:06 +00:00
Fix a panic in flow and cd into the test-client in run.sh
This commit is contained in:
parent
b15aa72ec0
commit
983b5a42e1
@ -76,7 +76,7 @@ func (h *HttpServer) flowCallback(rw http.ResponseWriter, req *http.Request, _ h
|
|||||||
q := req.URL.Query()
|
q := req.URL.Query()
|
||||||
state := q.Get("state")
|
state := q.Get("state")
|
||||||
n := strings.IndexByte(state, ':')
|
n := strings.IndexByte(state, ':')
|
||||||
if !h.manager.CheckNamespace(state[:n]) {
|
if n == -1 || !h.manager.CheckNamespace(state[:n]) {
|
||||||
http.Error(rw, "Invalid state namespace", http.StatusBadRequest)
|
http.Error(rw, "Invalid state namespace", http.StatusBadRequest)
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
@ -3,6 +3,7 @@ package pages
|
|||||||
import (
|
import (
|
||||||
"embed"
|
"embed"
|
||||||
_ "embed"
|
_ "embed"
|
||||||
|
"errors"
|
||||||
"github.com/1f349/overlapfs"
|
"github.com/1f349/overlapfs"
|
||||||
"html/template"
|
"html/template"
|
||||||
"io"
|
"io"
|
||||||
@ -26,7 +27,7 @@ func LoadPages(wd string) (err error) {
|
|||||||
if wd != "" {
|
if wd != "" {
|
||||||
wwwDir := filepath.Join(wd, "www")
|
wwwDir := filepath.Join(wd, "www")
|
||||||
err = os.Mkdir(wwwDir, os.ModePerm)
|
err = os.Mkdir(wwwDir, os.ModePerm)
|
||||||
if err != nil {
|
if err != nil && !errors.Is(err, os.ErrExist) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
wdFs := os.DirFS(wwwDir)
|
wdFs := os.DirFS(wwwDir)
|
||||||
|
@ -1,2 +1,4 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
cd "$(dirname -- "$(readlink -f -- "$0";)";)"
|
||||||
|
|
||||||
python3 -m http.server 2020
|
python3 -m http.server 2020
|
||||||
|
Loading…
Reference in New Issue
Block a user