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 {
171171 })
172172
173173 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())
175175 http.Error(w, err.Error(), http.StatusUnauthorized)
176176 return
177177 }
+1, -1
......@@ -140,7 +140,7 @@ func (web *webRouter) blogHandler(w http.ResponseWriter, r *http.Request) {
140140
141141 err = ts.Execute(w, data)
142142 if err != nil {
143- logger.Error("could not execute tempalte", "err", err)
143+ logger.Error("could not execute template", "err", err)
144144 http.Error(w, err.Error(), http.StatusInternalServerError)
145145 }
146146 }
+1, -1
......@@ -77,7 +77,7 @@ func (c *Cmd) bail(err error) {
7777
7878 func (c *Cmd) notice() {
7979 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")
8181 }
8282 }
8383
+1, -1
......@@ -90,7 +90,7 @@ func (h *ApiAssetHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
9090 status := http.StatusOK
9191 attempts := []string{}
9292 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)
9494 destUrl, err := url.Parse(fp.Filepath)
9595 if err != nil {
9696 http.Error(w, err.Error(), http.StatusInternalServerError)
+1, -1
......@@ -114,7 +114,7 @@ func (c *Cmd) accessLogs(_ context.Context) error {
114114 for _, log := range logs {
115115 jsonData, err := json.Marshal(log)
116116 if err != nil {
117- c.Log.Error("json marshall", "err", err)
117+ c.Log.Error("json marshal", "err", err)
118118 continue
119119 }
120120 c.output(string(jsonData))
+4, -4
......@@ -141,7 +141,7 @@ func (c *HttpCache) ServeHTTP(w http.ResponseWriter, r *http.Request) {
141141 c.Upstream.ServeHTTP(wrapped, r)
142142 c.AddUpstreamRequest()
143143 if wrapped.streaming {
144- log.Info("not cachable", "err", "response body too large")
144+ log.Info("not cacheable", "err", "response body too large")
145145 return
146146 }
147147
......@@ -221,7 +221,7 @@ func (c *HttpCache) ServeHTTP(w http.ResponseWriter, r *http.Request) {
221221 c.AddCacheItem(float64(len(enc)))
222222 wrapped.Header().Set("cache-status", cacheStatusMiss(cacheKey, true))
223223 } else {
224- log.Info("not cachable", "err", err)
224+ log.Info("not cacheable", "err", err)
225225 wrapped.Header().Set("cache-status", cacheStatusMiss(cacheKey, false))
226226 }
227227
......@@ -413,7 +413,7 @@ func isResponseCachable(r *http.Request, resp *responseWriter) error {
413413
414414 isValidStatus := isCacheableStatusCode(resp.StatusCode())
415415 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())
417417 }
418418
419419 state := parseCacheControl(resp.Header().Get("cache-control"))
......@@ -424,7 +424,7 @@ func isResponseCachable(r *http.Request, resp *responseWriter) error {
424424 return nil
425425 }
426426
427-// RFC 9110 15.1-2: Heuristically cachable status codes
427+// RFC 9110 15.1-2: Heuristically cacheable status codes
428428 // 200, 203, 204,
429429 // 206, 300, 301,
430430 // 308, 404, 405,
+1, -1
......@@ -541,7 +541,7 @@ func TestSSHServerCommandParsing(t *testing.T) {
541541
542542 expectedCommand := []string{"accept", "--comment", "here we go", "101"}
543543 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))
545545 }
546546
547547 // Trigger cancellation to stop the server