-
Notifications
You must be signed in to change notification settings - Fork 65
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix uripost test and go.mod Pull Request resolved: #161
- Loading branch information
Showing
12 changed files
with
557 additions
and
135 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
package simple | ||
|
||
import ( | ||
"net/http" | ||
"testing" | ||
|
||
. "github.com/onsi/ginkgo" | ||
. "github.com/onsi/gomega" | ||
) | ||
|
||
var _ = Describe("HTTPHeaders", func() { | ||
It("decode http config headers", func() { | ||
decodedConfigHeaders, err := DecodeHTTPConfigHeaders([]string{ | ||
"[Host: youhost.tld]", | ||
"[SomeHeader: somevalue]", | ||
}) | ||
expectHeaders := []Header{ | ||
{"Host", "youhost.tld"}, | ||
{"SomeHeader", "somevalue"}, | ||
} | ||
Expect(err).To(BeNil()) | ||
Expect(decodedConfigHeaders).To(Equal(expectHeaders)) | ||
}) | ||
|
||
It("add new http headers", func() { | ||
const origHost = "example.com" | ||
req, _ := http.NewRequest("GET", origHost, nil) | ||
req.Host = origHost | ||
req.Header.Set("SomeHeader", "oldvalue") | ||
headers := []Header{ | ||
{"Host", "youhost.tld"}, | ||
{"SomeHeader", "newvalue"}, | ||
{"SecondHeader", "new_second_value"}, | ||
} | ||
EnrichRequestWithHeaders(req, headers) | ||
Expect(req.Host).To(Equal(origHost)) | ||
Expect(req.Header).To(Equal(http.Header{ | ||
"Someheader": []string{"oldvalue"}, | ||
"Secondheader": []string{"new_second_value"}, | ||
})) | ||
}) | ||
}) | ||
|
||
func TestExample(t *testing.T) { | ||
RegisterFailHandler(Fail) | ||
RunSpecs(t, "Example Suite") | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,52 +1,64 @@ | ||
module github.com/yandex/pandora | ||
|
||
go 1.17 | ||
go 1.19 | ||
|
||
require ( | ||
github.com/asaskevich/govalidator v0.0.0-20171111151018-521b25f4b05f | ||
github.com/c2h5oh/datasize v0.0.0-20171227191756-4eba002a5eae | ||
github.com/asaskevich/govalidator v0.0.0-20210307081110-f21760c49a8d | ||
github.com/c2h5oh/datasize v0.0.0-20220606134207-859f65c6625b | ||
github.com/facebookgo/stack v0.0.0-20160209184415-751773369052 | ||
github.com/facebookgo/stackerr v0.0.0-20150612192056-c2fcf88613f4 | ||
github.com/ghodss/yaml v1.0.0 | ||
github.com/hashicorp/go-multierror v0.0.0-20171204182908-b7773ae21874 | ||
github.com/hashicorp/go-multierror v1.1.1 | ||
github.com/jhump/protoreflect v1.10.1 | ||
github.com/json-iterator/go v0.0.0-20180214060632-e7c7f3b33712 | ||
github.com/mitchellh/mapstructure v0.0.0-20180203102830-a4e142e9c047 | ||
github.com/onsi/ginkgo v1.4.0 | ||
github.com/onsi/gomega v1.3.0 | ||
github.com/pkg/errors v0.9.0 | ||
github.com/pquerna/ffjson v0.0.0-20171002144729-d49c2bc1aa13 | ||
github.com/spf13/afero v1.0.2 | ||
github.com/spf13/viper v1.0.0 | ||
github.com/stretchr/testify v1.7.0 | ||
go.uber.org/atomic v1.3.1 | ||
go.uber.org/zap v1.7.1 | ||
golang.org/x/net v0.0.0-20200822124328-c89045814202 | ||
google.golang.org/grpc v1.41.0 | ||
github.com/json-iterator/go v1.1.12 | ||
github.com/mitchellh/mapstructure v1.5.0 | ||
github.com/onsi/ginkgo v1.16.5 | ||
github.com/onsi/gomega v1.20.1 | ||
github.com/pkg/errors v0.9.1 | ||
github.com/pquerna/ffjson v0.0.0-20190930134022-aa0246cd15f7 | ||
github.com/spf13/afero v1.9.2 | ||
github.com/spf13/viper v1.13.0 | ||
github.com/stretchr/testify v1.8.1 | ||
go.uber.org/atomic v1.10.0 | ||
go.uber.org/zap v1.23.0 | ||
golang.org/x/net v0.3.0 | ||
google.golang.org/grpc v1.50.1 | ||
gopkg.in/bluesuncorp/validator.v9 v9.10.0 | ||
) | ||
|
||
require ( | ||
github.com/davecgh/go-spew v1.1.0 // indirect | ||
github.com/benbjohnson/clock v1.3.0 // indirect | ||
github.com/davecgh/go-spew v1.1.1 // indirect | ||
github.com/fsnotify/fsnotify v1.5.4 // indirect | ||
github.com/go-playground/locales v0.11.2 // indirect | ||
github.com/go-playground/universal-translator v0.16.0 // indirect | ||
github.com/golang/protobuf v1.4.3 // indirect | ||
github.com/hashicorp/errwrap v0.0.0-20141028054710-7554cd9344ce // indirect | ||
github.com/hashicorp/hcl v0.0.0-20171017181929-23c074d0eceb // indirect | ||
github.com/go-playground/locales v0.14.0 // indirect | ||
github.com/go-playground/universal-translator v0.18.0 // indirect | ||
github.com/golang/protobuf v1.5.2 // indirect | ||
github.com/google/go-cmp v0.5.9 // indirect | ||
github.com/hashicorp/errwrap v1.1.0 // indirect | ||
github.com/hashicorp/hcl v1.0.0 // indirect | ||
github.com/kr/pretty v0.3.1 // indirect | ||
github.com/magiconair/properties v1.8.6 // indirect | ||
github.com/pelletier/go-toml v1.1.0 // indirect | ||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect | ||
github.com/modern-go/reflect2 v1.0.2 // indirect | ||
github.com/nxadm/tail v1.4.8 // indirect | ||
github.com/onsi/ginkgo/v2 v2.1.6 // indirect | ||
github.com/pelletier/go-toml v1.9.5 // indirect | ||
github.com/pelletier/go-toml/v2 v2.0.5 // indirect | ||
github.com/pmezard/go-difflib v1.0.0 // indirect | ||
github.com/spf13/cast v1.2.0 // indirect | ||
github.com/spf13/jwalterweatherman v0.0.0-20180109140146-7c0cea34c8ec // indirect | ||
github.com/spf13/pflag v1.0.0 // indirect | ||
github.com/stretchr/objx v0.1.0 // indirect | ||
go.uber.org/multierr v1.1.0 // indirect | ||
golang.org/x/sys v0.0.0-20220926163933-8cfa568d3c25 // indirect | ||
golang.org/x/text v0.3.0 // indirect | ||
google.golang.org/genproto v0.0.0-20200526211855-cb27e3aa2013 // indirect | ||
google.golang.org/protobuf v1.25.1-0.20200805231151-a709e31e5d12 // indirect | ||
gopkg.in/go-playground/assert.v1 v1.2.1 // indirect | ||
gopkg.in/yaml.v2 v2.2.3 // indirect | ||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c // indirect | ||
github.com/spf13/cast v1.5.0 // indirect | ||
github.com/spf13/jwalterweatherman v1.1.0 // indirect | ||
github.com/spf13/pflag v1.0.6-0.20201009195203-85dd5c8bc61c // indirect | ||
github.com/stretchr/objx v0.5.0 // indirect | ||
github.com/subosito/gotenv v1.4.1 // indirect | ||
go.uber.org/goleak v1.2.0 // indirect | ||
go.uber.org/multierr v1.8.0 // indirect | ||
golang.org/x/sys v0.3.0 // indirect | ||
golang.org/x/text v0.5.0 // indirect | ||
google.golang.org/genproto v0.0.0-20220930163606-c98284e70a91 // indirect | ||
google.golang.org/protobuf v1.28.1 // indirect | ||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c // indirect | ||
gopkg.in/ini.v1 v1.67.0 // indirect | ||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 // indirect | ||
gopkg.in/yaml.v2 v2.4.0 // indirect | ||
gopkg.in/yaml.v3 v3.0.1 // indirect | ||
) |
Oops, something went wrong.