support multilevel subdomain, fix #1132

This commit is contained in:
fatedier
2019-03-15 16:22:41 +08:00
parent 6b61cb3742
commit 9be24db410
7 changed files with 71 additions and 250 deletions

View File

@@ -61,3 +61,17 @@ func notFoundResponse() *http.Response {
}
return res
}
func noAuthResponse() *http.Response {
header := make(map[string][]string)
header["WWW-Authenticate"] = []string{`Basic realm="Restricted"`}
res := &http.Response{
Status: "401 Not authorized",
StatusCode: 401,
Proto: "HTTP/1.1",
ProtoMajor: 1,
ProtoMinor: 1,
Header: header,
}
return res
}