Skip to content

Commit ec05bc8

Browse files
majianhanaldas
authored andcommitted
fix: correct spelling mistakes in comments and field name
Fix multiple typos found across the codebase: - response.go: rename unexported field "commited" to "committed" - server.go: fix "addres" to "address" in comment - middleware/csrf.go: fix "formated" to "formatted" in comment - middleware/request_logger.go: fix "commited" to "committed" in comment - echotest/context.go: fix "wil" to "will" in comments
1 parent 1753170 commit ec05bc8

File tree

5 files changed

+10
-10
lines changed

5 files changed

+10
-10
lines changed

echotest/context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,10 +24,10 @@ type ContextConfig struct {
2424
// Response will be used instead of default `httptest.NewRecorder()`
2525
Response *httptest.ResponseRecorder
2626

27-
// QueryValues wil be set as Request.URL.RawQuery value
27+
// QueryValues will be set as Request.URL.RawQuery value
2828
QueryValues url.Values
2929

30-
// Headers wil be set as Request.Header value
30+
// Headers will be set as Request.Header value
3131
Headers http.Header
3232

3333
// PathValues initializes context.PathValues with given value.

middleware/csrf.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ type CSRFConfig struct {
2828
Skipper Skipper
2929
// TrustedOrigin permits any request with `Sec-Fetch-Site` header whose `Origin` header
3030
// exactly matches the specified value.
31-
// Values should be formated as Origin header "scheme://host[:port]".
31+
// Values should be formatted as Origin header "scheme://host[:port]".
3232
//
3333
// See [Origin]: https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Origin
3434
// See [Sec-Fetch-Site]: https://cheatsheetseries.owasp.org/cheatsheets/Cross-Site_Request_Forgery_Prevention_Cheat_Sheet.html#fetch-metadata-headers

middleware/request_logger.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,7 +405,7 @@ func RequestLogger() echo.MiddlewareFunc {
405405
LogContentLength: true,
406406
LogResponseSize: true,
407407
// forwards error to the global error handler, so it can decide appropriate status code.
408-
// NB: side-effect of that is - request is now "commited" written to the client. Middlewares up in chain can not
408+
// NB: side-effect of that is - request is now "committed" written to the client. Middlewares up in chain can not
409409
// change Response status code or response body.
410410
HandleError: true,
411411
LogValuesFunc: func(c *echo.Context, v RequestLoggerValues) error {

response.go

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -135,19 +135,19 @@ func UnwrapResponse(rw http.ResponseWriter) (*Response, error) {
135135
// This allows (global) error handler to decide correct status code to be sent to the client.
136136
type delayedStatusWriter struct {
137137
http.ResponseWriter
138-
commited bool
138+
committed bool
139139
status int
140140
}
141141

142142
func (w *delayedStatusWriter) WriteHeader(statusCode int) {
143-
// in case something else writes status code explicitly before us we need mark response commited
144-
w.commited = true
143+
// in case something else writes status code explicitly before us we need mark response committed
144+
w.committed = true
145145
w.ResponseWriter.WriteHeader(statusCode)
146146
}
147147

148148
func (w *delayedStatusWriter) Write(data []byte) (int, error) {
149-
if !w.commited {
150-
w.commited = true
149+
if !w.committed {
150+
w.committed = true
151151
if w.status == 0 {
152152
w.status = http.StatusOK
153153
}

server.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ type StartConfig struct {
3838
// ListenerNetwork is used configure on which Network listener will use.
3939
ListenerNetwork string
4040
// ListenerAddrFunc will be called after listener is created and started to listen for connections. This is useful in
41-
// testing situations when server is started on random port `addres = ":0"` in that case you can get actual port where
41+
// testing situations when server is started on random port `address = ":0"` in that case you can get actual port where
4242
// listener is listening on.
4343
ListenerAddrFunc func(addr net.Addr)
4444

0 commit comments

Comments
 (0)