mirror of
https://github.com/1f349/lavender.git
synced 2024-12-21 23:24:09 +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()
|
||||
state := q.Get("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)
|
||||
return
|
||||
}
|
||||
|
@ -3,6 +3,7 @@ package pages
|
||||
import (
|
||||
"embed"
|
||||
_ "embed"
|
||||
"errors"
|
||||
"github.com/1f349/overlapfs"
|
||||
"html/template"
|
||||
"io"
|
||||
@ -26,7 +27,7 @@ func LoadPages(wd string) (err error) {
|
||||
if wd != "" {
|
||||
wwwDir := filepath.Join(wd, "www")
|
||||
err = os.Mkdir(wwwDir, os.ModePerm)
|
||||
if err != nil {
|
||||
if err != nil && !errors.Is(err, os.ErrExist) {
|
||||
return
|
||||
}
|
||||
wdFs := os.DirFS(wwwDir)
|
||||
|
@ -1,2 +1,4 @@
|
||||
#!/bin/bash
|
||||
cd "$(dirname -- "$(readlink -f -- "$0";)";)"
|
||||
|
||||
python3 -m http.server 2020
|
||||
|
Loading…
Reference in New Issue
Block a user