Initial euclide.org release

This commit is contained in:
2023-11-17 06:55:06 +01:00
commit 97379c8e8a
210 changed files with 32403 additions and 0 deletions

View File

@@ -0,0 +1,22 @@
package internal
import (
"context"
"net/http"
)
type submatchesKeyType struct{}
var submatchesKey submatchesKeyType
func SetSubmatches(req *http.Request, submatches []string) *http.Request {
if len(submatches) > 0 {
return req.WithContext(context.WithValue(req.Context(), submatchesKey, submatches))
}
return req
}
func GetSubmatches(req *http.Request) []string {
sm, _ := req.Context().Value(submatchesKey).([]string)
return sm
}