mirror of
https://github.com/caddyserver/caddy.git
synced 2025-05-28 22:55:50 +08:00
Implement most of static file server; refactor and improve Replacer
This commit is contained in:
@ -1,7 +1,6 @@
|
||||
package caddyhttp
|
||||
|
||||
import (
|
||||
"os"
|
||||
"reflect"
|
||||
"testing"
|
||||
)
|
||||
@ -115,11 +114,6 @@ func TestJoinListenerAddr(t *testing.T) {
|
||||
}
|
||||
|
||||
func TestParseListenerAddr(t *testing.T) {
|
||||
hostname, err := os.Hostname()
|
||||
if err != nil {
|
||||
t.Fatalf("Cannot ascertain system hostname: %v", err)
|
||||
}
|
||||
|
||||
for i, tc := range []struct {
|
||||
input string
|
||||
expectNetwork string
|
||||
@ -176,11 +170,6 @@ func TestParseListenerAddr(t *testing.T) {
|
||||
expectNetwork: "tcp",
|
||||
expectAddrs: []string{"localhost:0"},
|
||||
},
|
||||
{
|
||||
input: "{system.hostname}:0",
|
||||
expectNetwork: "tcp",
|
||||
expectAddrs: []string{hostname + ":0"},
|
||||
},
|
||||
} {
|
||||
actualNetwork, actualAddrs, err := parseListenAddr(tc.input)
|
||||
if tc.expectErr && err == nil {
|
||||
|
Reference in New Issue
Block a user