Migrate utils
This commit is contained in:
parent
37872dda87
commit
10bcfe65b2
@ -2,11 +2,13 @@ package mycoopts
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"errors"
|
"errors"
|
||||||
"git.sr.ht/~bouncepaw/mycomarkup/v5/options"
|
|
||||||
"github.com/bouncepaw/mycorrhiza/internal/cfg"
|
"github.com/bouncepaw/mycorrhiza/internal/cfg"
|
||||||
"github.com/bouncepaw/mycorrhiza/internal/hyphae"
|
"github.com/bouncepaw/mycorrhiza/internal/hyphae"
|
||||||
"github.com/bouncepaw/mycorrhiza/interwiki"
|
"github.com/bouncepaw/mycorrhiza/interwiki"
|
||||||
"github.com/bouncepaw/mycorrhiza/util"
|
"github.com/bouncepaw/mycorrhiza/util"
|
||||||
|
|
||||||
|
"git.sr.ht/~bouncepaw/mycomarkup/v5/options"
|
||||||
)
|
)
|
||||||
|
|
||||||
func MarkupOptions(hyphaName string) options.Options {
|
func MarkupOptions(hyphaName string) options.Options {
|
||||||
|
|||||||
@ -3,7 +3,7 @@ package util
|
|||||||
import (
|
import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
"log"
|
"log/slog"
|
||||||
"net/http"
|
"net/http"
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ func HyphaNameFromRq(rq *http.Request, actions ...string) string {
|
|||||||
return CanonicalName(strings.TrimPrefix(p, "/"+action+"/"))
|
return CanonicalName(strings.TrimPrefix(p, "/"+action+"/"))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
log.Println("HyphaNameFromRq: this request is invalid, fall back to home hypha")
|
slog.Info("HyphaNameFromRq: this request is invalid, fall back to home hypha")
|
||||||
return cfg.HomeHypha
|
return cfg.HomeHypha
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user