mirror of
https://github.com/caddyserver/caddy.git
synced 2025-02-05 08:38:26 +03:00
Fix misspellings
This commit is contained in:
parent
a122304196
commit
45a3d0b526
11 changed files with 26 additions and 26 deletions
|
@ -68,7 +68,7 @@ func (a BasicAuth) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error
|
|||
return a.Next.ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
// Pass-thru when no paths match
|
||||
// Pass-through when no paths match
|
||||
return a.Next.ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
|
|
|
@ -96,7 +96,7 @@ func TestSort(t *testing.T) {
|
|||
func TestBrowseHTTPMethods(t *testing.T) {
|
||||
tmpl, err := template.ParseFiles("testdata/photos.tpl")
|
||||
if err != nil {
|
||||
t.Fatalf("An error occured while parsing the template: %v", err)
|
||||
t.Fatalf("An error occurred while parsing the template: %v", err)
|
||||
}
|
||||
|
||||
b := Browse{
|
||||
|
@ -134,7 +134,7 @@ func TestBrowseHTTPMethods(t *testing.T) {
|
|||
func TestBrowseTemplate(t *testing.T) {
|
||||
tmpl, err := template.ParseFiles("testdata/photos.tpl")
|
||||
if err != nil {
|
||||
t.Fatalf("An error occured while parsing the template: %v", err)
|
||||
t.Fatalf("An error occurred while parsing the template: %v", err)
|
||||
}
|
||||
|
||||
b := Browse{
|
||||
|
|
|
@ -52,15 +52,15 @@ func TestSetup(t *testing.T) {
|
|||
c := caddy.NewTestController("http", test.input)
|
||||
err := setup(c)
|
||||
if err != nil && !test.shouldErr {
|
||||
t.Errorf("Test case #%d recieved an error of %v", i, err)
|
||||
t.Errorf("Test case #%d received an error of %v", i, err)
|
||||
}
|
||||
if test.expectedPathScope == nil {
|
||||
continue
|
||||
}
|
||||
mids := httpserver.GetConfig(c).Middleware()
|
||||
mid := mids[len(mids)-1]
|
||||
recievedConfigs := mid(nil).(Browse).Configs
|
||||
for j, config := range recievedConfigs {
|
||||
receivedConfigs := mid(nil).(Browse).Configs
|
||||
for j, config := range receivedConfigs {
|
||||
if config.PathScope != test.expectedPathScope[j] {
|
||||
t.Errorf("Test case #%d expected a pathscope of %v, but got %v", i, test.expectedPathScope, config.PathScope)
|
||||
}
|
||||
|
|
|
@ -21,7 +21,7 @@ type Ext struct {
|
|||
// Next handler in the chain
|
||||
Next httpserver.Handler
|
||||
|
||||
// Path to ther root of the site
|
||||
// Path to site root
|
||||
Root string
|
||||
|
||||
// List of extensions to try
|
||||
|
|
|
@ -206,7 +206,7 @@ func TestSetupIfMatcher(t *testing.T) {
|
|||
}`, true, IfMatcher{},
|
||||
},
|
||||
{`test {
|
||||
if a isnt b
|
||||
if a isn't b
|
||||
}`, true, IfMatcher{},
|
||||
},
|
||||
{`test {
|
||||
|
|
|
@ -45,7 +45,7 @@ func TestServeHTTP(t *testing.T) {
|
|||
t.Errorf("Test two: Expected nil error, but got: %v", err)
|
||||
}
|
||||
if w.Body.String() != "content" {
|
||||
t.Errorf("Expected pprof to pass the request thru, but it didn't; got: %s", w.Body.String())
|
||||
t.Errorf("Expected pprof to pass the request through, but it didn't; got: %s", w.Body.String())
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -69,25 +69,25 @@ func TestSetup(t *testing.T) {
|
|||
c := caddy.NewTestController("http", test.input)
|
||||
err := setup(c)
|
||||
if err != nil && !test.shouldErr {
|
||||
t.Errorf("Test case #%d recieved an error of %v", j, err)
|
||||
t.Errorf("Test case #%d received an error of %v", j, err)
|
||||
} else if test.shouldErr {
|
||||
continue
|
||||
}
|
||||
mids := httpserver.GetConfig(c).Middleware()
|
||||
recievedRules := mids[len(mids)-1](nil).(Redirect).Rules
|
||||
receivedRules := mids[len(mids)-1](nil).(Redirect).Rules
|
||||
|
||||
for i, recievedRule := range recievedRules {
|
||||
if recievedRule.FromPath != test.expectedRules[i].FromPath {
|
||||
t.Errorf("Test case #%d.%d expected a from path of %s, but recieved a from path of %s", j, i, test.expectedRules[i].FromPath, recievedRule.FromPath)
|
||||
for i, receivedRule := range receivedRules {
|
||||
if receivedRule.FromPath != test.expectedRules[i].FromPath {
|
||||
t.Errorf("Test case #%d.%d expected a from path of %s, but received a from path of %s", j, i, test.expectedRules[i].FromPath, receivedRule.FromPath)
|
||||
}
|
||||
if recievedRule.To != test.expectedRules[i].To {
|
||||
t.Errorf("Test case #%d.%d expected a TO path of %s, but recieved a TO path of %s", j, i, test.expectedRules[i].To, recievedRule.To)
|
||||
if receivedRule.To != test.expectedRules[i].To {
|
||||
t.Errorf("Test case #%d.%d expected a TO path of %s, but received a TO path of %s", j, i, test.expectedRules[i].To, receivedRule.To)
|
||||
}
|
||||
if recievedRule.Code != test.expectedRules[i].Code {
|
||||
t.Errorf("Test case #%d.%d expected a HTTP status code of %d, but recieved a code of %d", j, i, test.expectedRules[i].Code, recievedRule.Code)
|
||||
if receivedRule.Code != test.expectedRules[i].Code {
|
||||
t.Errorf("Test case #%d.%d expected a HTTP status code of %d, but received a code of %d", j, i, test.expectedRules[i].Code, receivedRule.Code)
|
||||
}
|
||||
if gotMatcher, expectMatcher := fmt.Sprint(recievedRule.RequestMatcher), fmt.Sprint(test.expectedRules[i].RequestMatcher); gotMatcher != expectMatcher {
|
||||
t.Errorf("Test case #%d.%d expected a Matcher %s, but recieved a Matcher %s", j, i, expectMatcher, gotMatcher)
|
||||
if gotMatcher, expectMatcher := fmt.Sprint(receivedRule.RequestMatcher), fmt.Sprint(test.expectedRules[i].RequestMatcher); gotMatcher != expectMatcher {
|
||||
t.Errorf("Test case #%d.%d expected a Matcher %s, but received a Matcher %s", j, i, expectMatcher, gotMatcher)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -72,7 +72,7 @@ func (ws WebSocket) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, erro
|
|||
}
|
||||
}
|
||||
|
||||
// Didn't match a websocket path, so pass-thru
|
||||
// Didn't match a websocket path, so pass-through
|
||||
return ws.Next.ServeHTTP(w, r)
|
||||
}
|
||||
|
||||
|
|
|
@ -248,7 +248,7 @@ func DeleteOldStapleFiles() {
|
|||
}
|
||||
for _, file := range files {
|
||||
if file.IsDir() {
|
||||
// wierd, what's a folder doing inside the OCSP cache?
|
||||
// weird, what's a folder doing inside the OCSP cache?
|
||||
continue
|
||||
}
|
||||
stapleFile := filepath.Join(ocspFolder, file.Name())
|
||||
|
|
|
@ -12,7 +12,7 @@ func TestParseUnixCommand(t *testing.T) {
|
|||
input string
|
||||
expected []string
|
||||
}{
|
||||
// 0 - emtpy command
|
||||
// 0 - empty command
|
||||
{
|
||||
input: ``,
|
||||
expected: []string{},
|
||||
|
@ -181,7 +181,7 @@ func TestSplitCommandAndArgs(t *testing.T) {
|
|||
expectedArgs []string
|
||||
expectedErrContent string
|
||||
}{
|
||||
// 0 - emtpy command
|
||||
// 0 - empty command
|
||||
{
|
||||
input: ``,
|
||||
expectedCommand: ``,
|
||||
|
|
|
@ -56,11 +56,11 @@ func TestStartup(t *testing.T) {
|
|||
}
|
||||
err = registeredFunction()
|
||||
if err != nil && !test.shouldExecutionErr {
|
||||
t.Errorf("Test %d recieved an error of:\n%v", i, err)
|
||||
t.Errorf("Test %d received an error of:\n%v", i, err)
|
||||
}
|
||||
err = os.Remove(osSenitiveTestDir)
|
||||
if err != nil && !test.shouldRemoveErr {
|
||||
t.Errorf("Test %d recieved an error of:\n%v", i, err)
|
||||
t.Errorf("Test %d received an error of:\n%v", i, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue