Skip to content

Commit

Permalink
override spew vendor to compile in a restricted env without the 'unsa…
Browse files Browse the repository at this point in the history
…fe' package
  • Loading branch information
troyxmccall committed Nov 5, 2023
1 parent 9b4f1e9 commit 6d2e093
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 185 deletions.
2 changes: 1 addition & 1 deletion docker-compose.local.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ version: "3.7"

services:
traefik:
image: traefik
image: traefik:v2.10.5
ports:
- "80:80"
- "8080:8080"
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
module github.com/madebymode/traefik-modsecurity-plugin

go 1.17
go 1.21

require (
github.com/davecgh/go-spew v1.1.1
github.com/patrickmn/go-cache v2.1.0+incompatible
github.com/stretchr/testify v1.7.0
)

require (
github.com/davecgh/go-spew v1.1.0 // indirect
github.com/pmezard/go-difflib v1.0.0 // indirect
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect
)
3 changes: 2 additions & 1 deletion go.sum
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8=
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
github.com/patrickmn/go-cache v2.1.0+incompatible h1:HRMgzkcYKYpi3C8ajMPV8OFXaaRUnok+kx1WdO15EQc=
github.com/patrickmn/go-cache v2.1.0+incompatible/go.mod h1:3Qf8kWWT7OJRJbdiICTKqZju1ZixQ/KpMGzzAfe6+WQ=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down
2 changes: 2 additions & 0 deletions modsecurity.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"context"
"crypto/tls"
"fmt"
"github.com/davecgh/go-spew/spew"
"github.com/patrickmn/go-cache"
"io"
"log"
Expand Down Expand Up @@ -165,6 +166,7 @@ func New(ctx context.Context, next http.Handler, config *Config, name string) (h
}

func (a *Modsecurity) ServeHTTP(rw http.ResponseWriter, req *http.Request) {
spew.Dump(req)
if req == nil {
a.logger.Println("Received a nil request")
http.Error(rw, "Bad Request", http.StatusBadRequest)
Expand Down
152 changes: 9 additions & 143 deletions vendor/github.com/davecgh/go-spew/spew/bypass.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

38 changes: 0 additions & 38 deletions vendor/github.com/davecgh/go-spew/spew/bypasssafe.go

This file was deleted.

0 comments on commit 6d2e093

Please sign in to comment.