Skip to content

Commit

Permalink
fix some typos
Browse files Browse the repository at this point in the history
Signed-off-by: teslaedison <qingchengqiushuang@gmail.com>
  • Loading branch information
teslaedison committed Mar 6, 2024
1 parent fa70db8 commit 0e7d132
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion context.go
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,7 @@ func (c *context) SetParamNames(names ...string) {

if len(c.pvalues) < l {
// Keeping the old pvalues just for backward compatibility, but it sounds that doesn't make sense to keep them,
// probably those values will be overriden in a Context#SetParamValues
// probably those values will be overridden in a Context#SetParamValues
newPvalues := make([]string, l)
copy(newPvalues, c.pvalues)
c.pvalues = newPvalues
Expand Down
2 changes: 1 addition & 1 deletion echo.go
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ func (e *Echo) Routers() map[string]*Router {
//
// NOTE: In case errors happens in middleware call-chain that is returning from handler (which did not return an error).
// When handler has already sent response (ala c.JSON()) and there is error in middleware that is returning from
// handler. Then the error that global error handler received will be ignored because we have already "commited" the
// handler. Then the error that global error handler received will be ignored because we have already "committed" the
// response and status code header has been sent to the client.
func (e *Echo) DefaultHTTPErrorHandler(err error, c Context) {

Expand Down
2 changes: 1 addition & 1 deletion ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ XFF: "x" "x, a" "x, a, b"
```
In this case, use **first _untrustable_ IP reading from right**. Never use first one reading from left, as it is
configurable by client. Here "trustable" means "you are sure the IP address belongs to your infrastructre".
configurable by client. Here "trustable" means "you are sure the IP address belongs to your infrastructure".
In above example, if `b` and `c` are trustable, the IP address of the client is `a` for both cases, never be `x`.
In Echo, use `ExtractIPFromXFFHeader(...TrustOption)`.
Expand Down
2 changes: 1 addition & 1 deletion middleware/request_logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ func TestRequestLogger_LogValuesFuncError(t *testing.T) {
e.ServeHTTP(rec, req)

// NOTE: when global error handler received error returned from middleware the status has already
// been written to the client and response has been "commited" therefore global error handler does not do anything
// been written to the client and response has been "committed" therefore global error handler does not do anything
// and error that bubbled up in middleware chain will not be reflected in response code.
assert.Equal(t, http.StatusTeapot, rec.Code)
assert.Equal(t, http.StatusTeapot, expect.Status)
Expand Down

0 comments on commit 0e7d132

Please sign in to comment.