mirror of
				https://github.com/caddyserver/caddy.git
				synced 2025-11-03 19:17:29 -05:00 
			
		
		
		
	Fix misspellings
This commit is contained in:
		
							parent
							
								
									a122304196
								
							
						
					
					
						commit
						45a3d0b526
					
				@ -68,7 +68,7 @@ func (a BasicAuth) ServeHTTP(w http.ResponseWriter, r *http.Request) (int, error
 | 
				
			|||||||
		return a.Next.ServeHTTP(w, r)
 | 
							return a.Next.ServeHTTP(w, r)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Pass-thru when no paths match
 | 
						// Pass-through when no paths match
 | 
				
			||||||
	return a.Next.ServeHTTP(w, r)
 | 
						return a.Next.ServeHTTP(w, r)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -96,7 +96,7 @@ func TestSort(t *testing.T) {
 | 
				
			|||||||
func TestBrowseHTTPMethods(t *testing.T) {
 | 
					func TestBrowseHTTPMethods(t *testing.T) {
 | 
				
			||||||
	tmpl, err := template.ParseFiles("testdata/photos.tpl")
 | 
						tmpl, err := template.ParseFiles("testdata/photos.tpl")
 | 
				
			||||||
	if err != nil {
 | 
						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{
 | 
						b := Browse{
 | 
				
			||||||
@ -134,7 +134,7 @@ func TestBrowseHTTPMethods(t *testing.T) {
 | 
				
			|||||||
func TestBrowseTemplate(t *testing.T) {
 | 
					func TestBrowseTemplate(t *testing.T) {
 | 
				
			||||||
	tmpl, err := template.ParseFiles("testdata/photos.tpl")
 | 
						tmpl, err := template.ParseFiles("testdata/photos.tpl")
 | 
				
			||||||
	if err != nil {
 | 
						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{
 | 
						b := Browse{
 | 
				
			||||||
 | 
				
			|||||||
@ -52,15 +52,15 @@ func TestSetup(t *testing.T) {
 | 
				
			|||||||
		c := caddy.NewTestController("http", test.input)
 | 
							c := caddy.NewTestController("http", test.input)
 | 
				
			||||||
		err := setup(c)
 | 
							err := setup(c)
 | 
				
			||||||
		if err != nil && !test.shouldErr {
 | 
							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 {
 | 
							if test.expectedPathScope == nil {
 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		mids := httpserver.GetConfig(c).Middleware()
 | 
							mids := httpserver.GetConfig(c).Middleware()
 | 
				
			||||||
		mid := mids[len(mids)-1]
 | 
							mid := mids[len(mids)-1]
 | 
				
			||||||
		recievedConfigs := mid(nil).(Browse).Configs
 | 
							receivedConfigs := mid(nil).(Browse).Configs
 | 
				
			||||||
		for j, config := range recievedConfigs {
 | 
							for j, config := range receivedConfigs {
 | 
				
			||||||
			if config.PathScope != test.expectedPathScope[j] {
 | 
								if config.PathScope != test.expectedPathScope[j] {
 | 
				
			||||||
				t.Errorf("Test case #%d expected a pathscope of %v, but got %v", i, test.expectedPathScope, config.PathScope)
 | 
									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 handler in the chain
 | 
				
			||||||
	Next httpserver.Handler
 | 
						Next httpserver.Handler
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Path to ther root of the site
 | 
						// Path to site root
 | 
				
			||||||
	Root string
 | 
						Root string
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// List of extensions to try
 | 
						// List of extensions to try
 | 
				
			||||||
 | 
				
			|||||||
@ -206,7 +206,7 @@ func TestSetupIfMatcher(t *testing.T) {
 | 
				
			|||||||
		 }`, true, IfMatcher{},
 | 
							 }`, true, IfMatcher{},
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		{`test {
 | 
							{`test {
 | 
				
			||||||
			if	a isnt b
 | 
								if	a isn't b
 | 
				
			||||||
		 }`, true, IfMatcher{},
 | 
							 }`, true, IfMatcher{},
 | 
				
			||||||
		},
 | 
							},
 | 
				
			||||||
		{`test {
 | 
							{`test {
 | 
				
			||||||
 | 
				
			|||||||
@ -45,7 +45,7 @@ func TestServeHTTP(t *testing.T) {
 | 
				
			|||||||
		t.Errorf("Test two: Expected nil error, but got: %v", err)
 | 
							t.Errorf("Test two: Expected nil error, but got: %v", err)
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
	if w.Body.String() != "content" {
 | 
						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)
 | 
							c := caddy.NewTestController("http", test.input)
 | 
				
			||||||
		err := setup(c)
 | 
							err := setup(c)
 | 
				
			||||||
		if err != nil && !test.shouldErr {
 | 
							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 {
 | 
							} else if test.shouldErr {
 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		mids := httpserver.GetConfig(c).Middleware()
 | 
							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 {
 | 
							for i, receivedRule := range receivedRules {
 | 
				
			||||||
			if recievedRule.FromPath != test.expectedRules[i].FromPath {
 | 
								if receivedRule.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)
 | 
									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 {
 | 
								if receivedRule.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)
 | 
									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 {
 | 
								if receivedRule.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)
 | 
									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 {
 | 
								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 recieved a Matcher %s", j, i, expectMatcher, gotMatcher)
 | 
									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)
 | 
						return ws.Next.ServeHTTP(w, r)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -248,7 +248,7 @@ func DeleteOldStapleFiles() {
 | 
				
			|||||||
	}
 | 
						}
 | 
				
			||||||
	for _, file := range files {
 | 
						for _, file := range files {
 | 
				
			||||||
		if file.IsDir() {
 | 
							if file.IsDir() {
 | 
				
			||||||
			// wierd, what's a folder doing inside the OCSP cache?
 | 
								// weird, what's a folder doing inside the OCSP cache?
 | 
				
			||||||
			continue
 | 
								continue
 | 
				
			||||||
		}
 | 
							}
 | 
				
			||||||
		stapleFile := filepath.Join(ocspFolder, file.Name())
 | 
							stapleFile := filepath.Join(ocspFolder, file.Name())
 | 
				
			||||||
 | 
				
			|||||||
@ -12,7 +12,7 @@ func TestParseUnixCommand(t *testing.T) {
 | 
				
			|||||||
		input    string
 | 
							input    string
 | 
				
			||||||
		expected []string
 | 
							expected []string
 | 
				
			||||||
	}{
 | 
						}{
 | 
				
			||||||
		// 0 - emtpy command
 | 
							// 0 - empty command
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			input:    ``,
 | 
								input:    ``,
 | 
				
			||||||
			expected: []string{},
 | 
								expected: []string{},
 | 
				
			||||||
@ -181,7 +181,7 @@ func TestSplitCommandAndArgs(t *testing.T) {
 | 
				
			|||||||
		expectedArgs       []string
 | 
							expectedArgs       []string
 | 
				
			||||||
		expectedErrContent string
 | 
							expectedErrContent string
 | 
				
			||||||
	}{
 | 
						}{
 | 
				
			||||||
		// 0 - emtpy command
 | 
							// 0 - empty command
 | 
				
			||||||
		{
 | 
							{
 | 
				
			||||||
			input:              ``,
 | 
								input:              ``,
 | 
				
			||||||
			expectedCommand:    ``,
 | 
								expectedCommand:    ``,
 | 
				
			||||||
 | 
				
			|||||||
@ -56,11 +56,11 @@ func TestStartup(t *testing.T) {
 | 
				
			|||||||
		}
 | 
							}
 | 
				
			||||||
		err = registeredFunction()
 | 
							err = registeredFunction()
 | 
				
			||||||
		if err != nil && !test.shouldExecutionErr {
 | 
							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)
 | 
							err = os.Remove(osSenitiveTestDir)
 | 
				
			||||||
		if err != nil && !test.shouldRemoveErr {
 | 
							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…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user