summaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
Diffstat (limited to 'contrib')
-rw-r--r--contrib/cgi/cgi.go4
-rw-r--r--contrib/tlsauth/auth_test.go12
-rw-r--r--contrib/tlsauth/gemini_test.go8
3 files changed, 16 insertions, 8 deletions
diff --git a/contrib/cgi/cgi.go b/contrib/cgi/cgi.go
index ab10622..71743a0 100644
--- a/contrib/cgi/cgi.go
+++ b/contrib/cgi/cgi.go
@@ -116,9 +116,7 @@ func RunCGI(
}
scriptName := req.Path[:len(req.Path)-infoLen]
- if strings.HasSuffix(scriptName, "/") {
- scriptName = scriptName[:len(scriptName)-1]
- }
+ scriptName = strings.TrimSuffix(scriptName, "/")
cmd := exec.CommandContext(ctx, "./"+basename)
cmd.Env = prepareCGIEnv(ctx, req, scriptName, pathInfo)
diff --git a/contrib/tlsauth/auth_test.go b/contrib/tlsauth/auth_test.go
index 41292b4..fc39359 100644
--- a/contrib/tlsauth/auth_test.go
+++ b/contrib/tlsauth/auth_test.go
@@ -38,7 +38,9 @@ func TestIdentify(t *testing.T) {
leafCert, err := x509.ParseCertificate(clientCert.Certificate[0])
require.Nil(t, err)
- go server.Serve()
+ go func() {
+ _ = server.Serve()
+ }()
defer server.Close()
requestPath(t, client, server, "/")
@@ -75,7 +77,9 @@ func TestRequiredAuth(t *testing.T) {
gus.FallthroughHandler(handler1, handler2),
)
- go server.Serve()
+ go func() {
+ _ = server.Serve()
+ }()
defer server.Close()
requestPath(t, client, server, "/one")
@@ -113,7 +117,9 @@ func TestOptionalAuth(t *testing.T) {
handler,
)
- go server.Serve()
+ go func() {
+ _ = server.Serve()
+ }()
defer server.Close()
requestPath(t, client, server, "/one")
diff --git a/contrib/tlsauth/gemini_test.go b/contrib/tlsauth/gemini_test.go
index bc87958..8f1efda 100644
--- a/contrib/tlsauth/gemini_test.go
+++ b/contrib/tlsauth/gemini_test.go
@@ -54,7 +54,9 @@ func TestGeminiAuth(t *testing.T) {
authlessClient, _ := clientFor(t, server, "", "")
- go server.Serve()
+ go func() {
+ _ = server.Serve()
+ }()
defer server.Close()
resp := requestPath(t, authClient, server, "/one")
@@ -94,7 +96,9 @@ func TestGeminiOptionalAuth(t *testing.T) {
)
authlessClient, _ := clientFor(t, server, "", "")
- go server.Serve()
+ go func() {
+ _ = server.Serve()
+ }()
defer server.Close()
resp := requestPath(t, authClient, server, "/one")