mirror of
https://github.com/caddyserver/caddy.git
synced 2024-11-22 13:29:01 +08:00
Fix typos (#3087)
* Fix typo * Fix typo, thanks for Spell Checker under VS Code
This commit is contained in:
parent
e2d41ee761
commit
ca5c679880
|
@ -256,7 +256,7 @@ func TestRecursiveImport(t *testing.T) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if len(got.Segments[0]) != 1 || len(got.Segments[1]) != 2 {
|
if len(got.Segments[0]) != 1 || len(got.Segments[1]) != 2 {
|
||||||
t.Errorf("got unexpect tokens: %v", got.Segments)
|
t.Errorf("got unexpected tokens: %v", got.Segments)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
@ -351,7 +351,7 @@ func TestDirectiveImport(t *testing.T) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
if len(got.Segments[0]) != 1 || len(got.Segments[1]) != 8 {
|
if len(got.Segments[0]) != 1 || len(got.Segments[1]) != 8 {
|
||||||
t.Errorf("got unexpect tokens: %v", got.Segments)
|
t.Errorf("got unexpected tokens: %v", got.Segments)
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
return true
|
return true
|
||||||
|
|
|
@ -45,7 +45,7 @@ import (
|
||||||
// key of its server block (specifying the host part), and each key may have
|
// key of its server block (specifying the host part), and each key may have
|
||||||
// a different port. And we definitely need to be sure that a site which is
|
// a different port. And we definitely need to be sure that a site which is
|
||||||
// bound to be served on a specific interface is not served on others just
|
// bound to be served on a specific interface is not served on others just
|
||||||
// beceause that is more convenient: it would be a potential security risk
|
// because that is more convenient: it would be a potential security risk
|
||||||
// if the difference between interfaces means private vs. public.
|
// if the difference between interfaces means private vs. public.
|
||||||
//
|
//
|
||||||
// So what this function does for the example above is iterate each server
|
// So what this function does for the example above is iterate each server
|
||||||
|
|
|
@ -972,12 +972,12 @@ func sliceContains(haystack []string, needle string) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// specifity returns len(s) minus any wildcards (*) and
|
// specificity returns len(s) minus any wildcards (*) and
|
||||||
// placeholders ({...}). Basically, it's a length count
|
// placeholders ({...}). Basically, it's a length count
|
||||||
// that penalizes the use of wildcards and placeholders.
|
// that penalizes the use of wildcards and placeholders.
|
||||||
// This is useful for comparing hostnames and paths.
|
// This is useful for comparing hostnames and paths.
|
||||||
// However, wildcards in paths are not a sure answer to
|
// However, wildcards in paths are not a sure answer to
|
||||||
// the question of specificity. For exmaple,
|
// the question of specificity. For example,
|
||||||
// '*.example.com' is clearly less specific than
|
// '*.example.com' is clearly less specific than
|
||||||
// 'a.example.com', but is '/a' more or less specific
|
// 'a.example.com', but is '/a' more or less specific
|
||||||
// than '/a*'?
|
// than '/a*'?
|
||||||
|
@ -1018,7 +1018,7 @@ type namedCustomLog struct {
|
||||||
log *caddy.CustomLog
|
log *caddy.CustomLog
|
||||||
}
|
}
|
||||||
|
|
||||||
// sbAddrAssocation is a mapping from a list of
|
// sbAddrAssociation is a mapping from a list of
|
||||||
// addresses to a list of server blocks that are
|
// addresses to a list of server blocks that are
|
||||||
// served on those addresses.
|
// served on those addresses.
|
||||||
type sbAddrAssociation struct {
|
type sbAddrAssociation struct {
|
||||||
|
|
|
@ -211,7 +211,7 @@ func (ctx Context) LoadModule(structPointer interface{}, fieldName string) (inte
|
||||||
}
|
}
|
||||||
|
|
||||||
// loadModulesFromSomeMap loads modules from val, which must be a type of map[string]interface{}.
|
// loadModulesFromSomeMap loads modules from val, which must be a type of map[string]interface{}.
|
||||||
// Depending on inlineModuleKey, it will be interpeted as either a ModuleMap (key is the module
|
// Depending on inlineModuleKey, it will be interpreted as either a ModuleMap (key is the module
|
||||||
// name) or as a regular map (key is not the module name, and module name is defined inline).
|
// name) or as a regular map (key is not the module name, and module name is defined inline).
|
||||||
func (ctx Context) loadModulesFromSomeMap(namespace, inlineModuleKey string, val reflect.Value) (map[string]interface{}, error) {
|
func (ctx Context) loadModulesFromSomeMap(namespace, inlineModuleKey string, val reflect.Value) (map[string]interface{}, error) {
|
||||||
// if no inline_key is specified, then val must be a ModuleMap,
|
// if no inline_key is specified, then val must be a ModuleMap,
|
||||||
|
|
|
@ -282,7 +282,7 @@ func acceptedEncodings(r *http.Request) []string {
|
||||||
}
|
}
|
||||||
|
|
||||||
// encodings with q-factor of 0 are not accepted;
|
// encodings with q-factor of 0 are not accepted;
|
||||||
// use a small theshold to account for float precision
|
// use a small threshold to account for float precision
|
||||||
if qFactor < 0.00001 {
|
if qFactor < 0.00001 {
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
|
@ -51,7 +51,7 @@ type MatchFile struct {
|
||||||
Root string `json:"root,omitempty"`
|
Root string `json:"root,omitempty"`
|
||||||
|
|
||||||
// The list of files to try. Each path here is
|
// The list of files to try. Each path here is
|
||||||
// considered relatice to Root. If nil, the request
|
// considered related to Root. If nil, the request
|
||||||
// URL's path will be assumed. Files and
|
// URL's path will be assumed. Files and
|
||||||
// directories are treated distinctly, so to match
|
// directories are treated distinctly, so to match
|
||||||
// a directory, the filepath MUST end in a forward
|
// a directory, the filepath MUST end in a forward
|
||||||
|
|
|
@ -680,7 +680,7 @@ func (m MatchRemoteIP) Match(r *http.Request) bool {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
// MatchRegexp is an embeddable type for matching
|
// MatchRegexp is an embedable type for matching
|
||||||
// using regular expressions. It adds placeholders
|
// using regular expressions. It adds placeholders
|
||||||
// to the request's replacer.
|
// to the request's replacer.
|
||||||
type MatchRegexp struct {
|
type MatchRegexp struct {
|
||||||
|
|
|
@ -105,7 +105,7 @@ func (t *Transport) UnmarshalCaddyfile(d *caddyfile.Dispenser) error {
|
||||||
// }
|
// }
|
||||||
//
|
//
|
||||||
// Thus, this directive produces multiple handlers, each with a different
|
// Thus, this directive produces multiple handlers, each with a different
|
||||||
// matcher because multiple consecutive hgandlers are necessary to support
|
// matcher because multiple consecutive handlers are necessary to support
|
||||||
// the common PHP use case. If this "common" config is not compatible
|
// the common PHP use case. If this "common" config is not compatible
|
||||||
// with a user's PHP requirements, they can use a manual approach based
|
// with a user's PHP requirements, they can use a manual approach based
|
||||||
// on the example above to configure it precisely as they need.
|
// on the example above to configure it precisely as they need.
|
||||||
|
|
|
@ -27,7 +27,7 @@ import (
|
||||||
// Host represents a remote host which can be proxied to.
|
// Host represents a remote host which can be proxied to.
|
||||||
// Its methods must be safe for concurrent use.
|
// Its methods must be safe for concurrent use.
|
||||||
type Host interface {
|
type Host interface {
|
||||||
// NumRequests returns the numnber of requests
|
// NumRequests returns the number of requests
|
||||||
// currently in process with the host.
|
// currently in process with the host.
|
||||||
NumRequests() int
|
NumRequests() int
|
||||||
|
|
||||||
|
|
|
@ -254,7 +254,7 @@ func (t *Templates) ServeHTTP(w http.ResponseWriter, r *http.Request, next caddy
|
||||||
rec.Header().Del("Accept-Ranges") // we don't know ranges for dynamically-created content
|
rec.Header().Del("Accept-Ranges") // we don't know ranges for dynamically-created content
|
||||||
rec.Header().Del("Last-Modified") // useless for dynamic content since it's always changing
|
rec.Header().Del("Last-Modified") // useless for dynamic content since it's always changing
|
||||||
|
|
||||||
// we don't know a way to guickly generate etag for dynamic content,
|
// we don't know a way to quickly generate etag for dynamic content,
|
||||||
// and weak etags still cause browsers to rely on it even after a
|
// and weak etags still cause browsers to rely on it even after a
|
||||||
// refresh, so disable them until we find a better way to do this
|
// refresh, so disable them until we find a better way to do this
|
||||||
rec.Header().Del("Etag")
|
rec.Header().Del("Etag")
|
||||||
|
|
|
@ -229,7 +229,7 @@ func onDemandAskRequest(ask string, name string) error {
|
||||||
|
|
||||||
resp, err := onDemandAskClient.Get(askURL.String())
|
resp, err := onDemandAskClient.Get(askURL.String())
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("error checking %v to deterine if certificate for hostname '%s' should be allowed: %v",
|
return fmt.Errorf("error checking %v to determine if certificate for hostname '%s' should be allowed: %v",
|
||||||
ask, name, err)
|
ask, name, err)
|
||||||
}
|
}
|
||||||
resp.Body.Close()
|
resp.Body.Close()
|
||||||
|
|
Loading…
Reference in New Issue
Block a user