Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandro benassi trenta committed Dec 23, 2023
1 parent 55549c2 commit 9b6067e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## NOTICE: TESTS MISSING
This works for my use case, I will add tests probably early next years, busy with others things, if you want to add test you are more than welcome! <3
The file `x-real-ip-overwriter_test.go` should contain the logic of the tests, it is now absent.
The file `x-real-ip-overwrite_test.go` should contain the logic of the tests, it is now absent.

## What is this?

Expand Down Expand Up @@ -35,7 +35,7 @@ http:
middlewares:
real-ip: # the name to use in chains - you can change this
plugin:
x-real-ip-overwriter:
x-real-ip-overwrite:
header-name: "CF-Connecting-IP" # or watever the header is called
```

Expand Down
6 changes: 3 additions & 3 deletions x-real-ip-overwriter.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func CreateConfig() *Config {
}

// Demo a Demo plugin.
type XRealIPOverwriter struct {
type XRealIPOverwrite struct {
next http.Handler
headerName string
name string
Expand All @@ -37,14 +37,14 @@ func New(ctx context.Context, next http.Handler, config *Config, name string) (h
return nil, fmt.Errorf("header name cannot be empty")
}

return &XRealIPOverwriter{
return &XRealIPOverwrite{
next: next,
headerName: config.headerName,
name: name,
}, nil
}

func (xrip *XRealIPOverwriter) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
func (xrip *XRealIPOverwrite) ServeHTTP(rw http.ResponseWrite, req *http.Request) {

Check failure on line 47 in x-real-ip-overwriter.go

View workflow job for this annotation

GitHub Actions / Go (1.19, ubuntu-latest)

undefined: http.ResponseWrite

Check failure on line 47 in x-real-ip-overwriter.go

View workflow job for this annotation

GitHub Actions / Go (1.19, macos-latest)

undefined: http.ResponseWrite

Check failure on line 47 in x-real-ip-overwriter.go

View workflow job for this annotation

GitHub Actions / Go (1.x, macos-latest)

undefined: http.ResponseWrite
ip := req.Header.Get(xrip.headerName)
if ip != "" {
realWrong := req.Header.Get(XRealIP)
Expand Down

0 comments on commit 9b6067e

Please sign in to comment.