summaryrefslogtreecommitdiff
path: root/contrib/cgi
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/cgi')
-rw-r--r--contrib/cgi/cgi.go6
-rw-r--r--contrib/cgi/cgi_test.go10
-rw-r--r--contrib/cgi/gemini.go8
-rw-r--r--contrib/cgi/gopher.go8
-rw-r--r--contrib/cgi/spartan.go8
5 files changed, 20 insertions, 20 deletions
diff --git a/contrib/cgi/cgi.go b/contrib/cgi/cgi.go
index e57f2d0..6c727aa 100644
--- a/contrib/cgi/cgi.go
+++ b/contrib/cgi/cgi.go
@@ -13,7 +13,7 @@ import (
"os/exec"
"strings"
- "tildegit.org/tjp/gus"
+ sr "tildegit.org/tjp/sliderule"
)
// ResolveCGI finds a CGI program corresponding to a request path.
@@ -91,7 +91,7 @@ func isNotExistError(err error) bool {
// RunCGI runs a specific program as a CGI script.
func RunCGI(
ctx context.Context,
- request *gus.Request,
+ request *sr.Request,
executable string,
pathInfo string,
) (io.Reader, int, error) {
@@ -130,7 +130,7 @@ func RunCGI(
func prepareCGIEnv(
ctx context.Context,
- request *gus.Request,
+ request *sr.Request,
scriptName string,
pathInfo string,
) []string {
diff --git a/contrib/cgi/cgi_test.go b/contrib/cgi/cgi_test.go
index 5c1ca33..ff2c45d 100644
--- a/contrib/cgi/cgi_test.go
+++ b/contrib/cgi/cgi_test.go
@@ -12,9 +12,9 @@ import (
"github.com/stretchr/testify/assert"
"github.com/stretchr/testify/require"
- "tildegit.org/tjp/gus"
- "tildegit.org/tjp/gus/contrib/cgi"
- "tildegit.org/tjp/gus/gemini"
+ sr "tildegit.org/tjp/sliderule"
+ "tildegit.org/tjp/sliderule/contrib/cgi"
+ "tildegit.org/tjp/sliderule/gemini"
)
func TestCGIDirectory(t *testing.T) {
@@ -30,7 +30,7 @@ func TestCGIDirectory(t *testing.T) {
tests := []struct {
requestPath string
- responseCode gus.Status
+ responseCode sr.Status
responseBody string
}{
{
@@ -69,7 +69,7 @@ func TestCGIDirectory(t *testing.T) {
code, err := strconv.Atoi(string(response[:2]))
if assert.Nil(t, err) {
- assert.Equal(t, test.responseCode, gus.Status(code))
+ assert.Equal(t, test.responseCode, sr.Status(code))
}
_, body, found := strings.Cut(string(response), "\r\n")
diff --git a/contrib/cgi/gemini.go b/contrib/cgi/gemini.go
index 1587037..d245c8e 100644
--- a/contrib/cgi/gemini.go
+++ b/contrib/cgi/gemini.go
@@ -5,8 +5,8 @@ import (
"fmt"
"strings"
- "tildegit.org/tjp/gus"
- "tildegit.org/tjp/gus/gemini"
+ sr "tildegit.org/tjp/sliderule"
+ "tildegit.org/tjp/sliderule/gemini"
)
// GeminiCGIDirectory runs any executable files relative to a root directory on the file system.
@@ -15,9 +15,9 @@ import (
// a request for /foo/bar/baz can also run an executable found at /foo or /foo/bar. In
// such a case the PATH_INFO environment variable will include the remaining portion of
// the URI path.
-func GeminiCGIDirectory(pathRoot, fsRoot string) gus.Handler {
+func GeminiCGIDirectory(pathRoot, fsRoot string) sr.Handler {
fsRoot = strings.TrimRight(fsRoot, "/")
- return gus.HandlerFunc(func(ctx context.Context, request *gus.Request) *gus.Response {
+ return sr.HandlerFunc(func(ctx context.Context, request *sr.Request) *sr.Response {
if !strings.HasPrefix(request.Path, pathRoot) {
return nil
}
diff --git a/contrib/cgi/gopher.go b/contrib/cgi/gopher.go
index 4378eb7..290adfa 100644
--- a/contrib/cgi/gopher.go
+++ b/contrib/cgi/gopher.go
@@ -5,8 +5,8 @@ import (
"fmt"
"strings"
- "tildegit.org/tjp/gus"
- "tildegit.org/tjp/gus/gopher"
+ sr "tildegit.org/tjp/sliderule"
+ "tildegit.org/tjp/sliderule/gopher"
)
// GopherCGIDirectory runs any executable files relative to a root directory on the file system.
@@ -15,9 +15,9 @@ import (
// a request for /foo/bar/baz can also run an executable found at /foo or /foo/bar. In
// such a case the PATH_INFO environment variable will include the remaining portion of
// the URI path.
-func GopherCGIDirectory(pathRoot, fsRoot string) gus.Handler {
+func GopherCGIDirectory(pathRoot, fsRoot string) sr.Handler {
fsRoot = strings.TrimRight(fsRoot, "/")
- return gus.HandlerFunc(func(ctx context.Context, request *gus.Request) *gus.Response {
+ return sr.HandlerFunc(func(ctx context.Context, request *sr.Request) *sr.Response {
if !strings.HasPrefix(request.Path, pathRoot) {
return nil
}
diff --git a/contrib/cgi/spartan.go b/contrib/cgi/spartan.go
index 01ebb19..6994466 100644
--- a/contrib/cgi/spartan.go
+++ b/contrib/cgi/spartan.go
@@ -5,8 +5,8 @@ import (
"fmt"
"strings"
- "tildegit.org/tjp/gus"
- "tildegit.org/tjp/gus/spartan"
+ sr "tildegit.org/tjp/sliderule"
+ "tildegit.org/tjp/sliderule/spartan"
)
// SpartanCGIDirectory runs executable files relative to a root directory in the file system.
@@ -14,9 +14,9 @@ import (
// It will also find any run any executable _part way_ through the path, so for example a
// request for /foo/bar/baz can also run an executable found at /foo or /foo/bar. In such
// a case the PATH_INFO environment variable will include the remaining portion of the URI.
-func SpartanCGIDirectory(pathRoot, fsRoot string) gus.Handler {
+func SpartanCGIDirectory(pathRoot, fsRoot string) sr.Handler {
fsRoot = strings.TrimRight(fsRoot, "/")
- return gus.HandlerFunc(func(ctx context.Context, request *gus.Request) *gus.Response {
+ return sr.HandlerFunc(func(ctx context.Context, request *sr.Request) *sr.Response {
if !strings.HasPrefix(request.Path, pathRoot) {
return nil
}