Commit eea11fa
Antonio Mika
·
2026-10-25 22:21:46 -0400 EDT
parent 52adb76
fix: correct typos in error and log messages
7 files changed,
+10,
-10
+1,
-1
| ... | ... | @@ -171,7 +171,7 @@ func authorizeHandler(apiConfig *ApiConfig) http.HandlerFunc { | |
| 171 | 171 | }) | |
| 172 | 172 | ||
| 173 | 173 | if err != nil { | |
| 174 | - | apiConfig.Cfg.Logger.Error("cannot execture template", "err", err.Error()) | |
| 174 | + | apiConfig.Cfg.Logger.Error("cannot execute template", "err", err.Error()) | |
| 175 | 175 | http.Error(w, err.Error(), http.StatusUnauthorized) | |
| 176 | 176 | return | |
| 177 | 177 | } |
+1,
-1
| ... | ... | @@ -140,7 +140,7 @@ func (web *webRouter) blogHandler(w http.ResponseWriter, r *http.Request) { | |
| 140 | 140 | ||
| 141 | 141 | err = ts.Execute(w, data) | |
| 142 | 142 | if err != nil { | |
| 143 | - | logger.Error("could not execute tempalte", "err", err) | |
| 143 | + | logger.Error("could not execute template", "err", err) | |
| 144 | 144 | http.Error(w, err.Error(), http.StatusInternalServerError) | |
| 145 | 145 | } | |
| 146 | 146 | } |
+1,
-1
| ... | ... | @@ -77,7 +77,7 @@ func (c *Cmd) bail(err error) { | |
| 77 | 77 | ||
| 78 | 78 | func (c *Cmd) notice() { | |
| 79 | 79 | if !c.Write { | |
| 80 | - | c.output("\nNOTICE: changes not commited, use `--write` to save operation") | |
| 80 | + | c.output("\nNOTICE: changes not committed, use `--write` to save operation") | |
| 81 | 81 | } | |
| 82 | 82 | } | |
| 83 | 83 |
+1,
-1
| ... | ... | @@ -90,7 +90,7 @@ func (h *ApiAssetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) { | |
| 90 | 90 | status := http.StatusOK | |
| 91 | 91 | attempts := []string{} | |
| 92 | 92 | for _, fp := range routes { | |
| 93 | - | logger.Info("attemptming to serve route", "route", fp.Filepath, "status", fp.Status, "query", fp.Query) | |
| 93 | + | logger.Info("attempting to serve route", "route", fp.Filepath, "status", fp.Status, "query", fp.Query) | |
| 94 | 94 | destUrl, err := url.Parse(fp.Filepath) | |
| 95 | 95 | if err != nil { | |
| 96 | 96 | http.Error(w, err.Error(), http.StatusInternalServerError) |
+1,
-1
| ... | ... | @@ -114,7 +114,7 @@ func (c *Cmd) accessLogs(_ context.Context) error { | |
| 114 | 114 | for _, log := range logs { | |
| 115 | 115 | jsonData, err := json.Marshal(log) | |
| 116 | 116 | if err != nil { | |
| 117 | - | c.Log.Error("json marshall", "err", err) | |
| 117 | + | c.Log.Error("json marshal", "err", err) | |
| 118 | 118 | continue | |
| 119 | 119 | } | |
| 120 | 120 | c.output(string(jsonData)) |
+4,
-4
| ... | ... | @@ -141,7 +141,7 @@ func (c *HttpCache) ServeHTTP(w http.ResponseWriter, r *http.Request) { | |
| 141 | 141 | c.Upstream.ServeHTTP(wrapped, r) | |
| 142 | 142 | c.AddUpstreamRequest() | |
| 143 | 143 | if wrapped.streaming { | |
| 144 | - | log.Info("not cachable", "err", "response body too large") | |
| 144 | + | log.Info("not cacheable", "err", "response body too large") | |
| 145 | 145 | return | |
| 146 | 146 | } | |
| 147 | 147 |
| ... | ... | @@ -221,7 +221,7 @@ func (c *HttpCache) ServeHTTP(w http.ResponseWriter, r *http.Request) { | |
| 221 | 221 | c.AddCacheItem(float64(len(enc))) | |
| 222 | 222 | wrapped.Header().Set("cache-status", cacheStatusMiss(cacheKey, true)) | |
| 223 | 223 | } else { | |
| 224 | - | log.Info("not cachable", "err", err) | |
| 224 | + | log.Info("not cacheable", "err", err) | |
| 225 | 225 | wrapped.Header().Set("cache-status", cacheStatusMiss(cacheKey, false)) | |
| 226 | 226 | } | |
| 227 | 227 |
| ... | ... | @@ -413,7 +413,7 @@ func isResponseCachable(r *http.Request, resp *responseWriter) error { | |
| 413 | 413 | ||
| 414 | 414 | isValidStatus := isCacheableStatusCode(resp.StatusCode()) | |
| 415 | 415 | if !isValidStatus { | |
| 416 | - | return fmt.Errorf("response status code not cachable: %d", resp.StatusCode()) | |
| 416 | + | return fmt.Errorf("response status code not cacheable: %d", resp.StatusCode()) | |
| 417 | 417 | } | |
| 418 | 418 | ||
| 419 | 419 | state := parseCacheControl(resp.Header().Get("cache-control")) |
| ... | ... | @@ -424,7 +424,7 @@ func isResponseCachable(r *http.Request, resp *responseWriter) error { | |
| 424 | 424 | return nil | |
| 425 | 425 | } | |
| 426 | 426 | ||
| 427 | - | // RFC 9110 15.1-2: Heuristically cachable status codes | |
| 427 | + | // RFC 9110 15.1-2: Heuristically cacheable status codes | |
| 428 | 428 | // 200, 203, 204, | |
| 429 | 429 | // 206, 300, 301, | |
| 430 | 430 | // 308, 404, 405, |
+1,
-1
| ... | ... | @@ -541,7 +541,7 @@ func TestSSHServerCommandParsing(t *testing.T) { | |
| 541 | 541 | ||
| 542 | 542 | expectedCommand := []string{"accept", "--comment", "here we go", "101"} | |
| 543 | 543 | if !slices.Equal(expectedCommand, capturedCommand) { | |
| 544 | - | t.Error("command not exected", capturedCommand, len(capturedCommand), expectedCommand, len(expectedCommand)) | |
| 544 | + | t.Error("command not expected", capturedCommand, len(capturedCommand), expectedCommand, len(expectedCommand)) | |
| 545 | 545 | } | |
| 546 | 546 | ||
| 547 | 547 | // Trigger cancellation to stop the server |