Skip to content

Commit

Permalink
Merge pull request #47 from xmidt-org/feature/upgrade-httpaux
Browse files Browse the repository at this point in the history
Feature/upgrade httpaux
  • Loading branch information
johnabass authored Mar 30, 2021
2 parents d96cb1c + 003dfdf commit 8a452e9
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).

## [Unreleased]
- upgraded to httpaux v0.1.6

## [v0.2.2]
- Refactored dependency reflection to make it easier to use
Expand Down
2 changes: 1 addition & 1 deletion arrangehttp/client.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ func (cc ClientConfig) NewClient() (client *http.Client, err error) {
header := httpaux.NewHeader(cc.Header)
transport, err := cc.Transport.NewTransport(cc.TLS)
if err == nil {
client.Transport = header.RoundTrip(transport)
client.Transport = roundtrip.Header(header.SetTo)(transport)
}

return
Expand Down
3 changes: 2 additions & 1 deletion arrangehttp/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"github.com/xmidt-org/arrange"
"github.com/xmidt-org/arrange/arrangetls"
"github.com/xmidt-org/httpaux"
serveraux "github.com/xmidt-org/httpaux/server"
"go.uber.org/fx"
"go.uber.org/multierr"
)
Expand Down Expand Up @@ -77,7 +78,7 @@ func (sc ServerConfig) NewServer(h http.Handler) (server *http.Server, err error

server = &http.Server{
Addr: sc.Address,
Handler: header.Then(h),
Handler: serveraux.Header(header.SetTo)(h),
ReadTimeout: sc.ReadTimeout,
ReadHeaderTimeout: sc.ReadHeaderTimeout,
WriteTimeout: sc.WriteTimeout,
Expand Down
2 changes: 0 additions & 2 deletions arrangehttp/server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,6 @@ func testServerConfigBasic(t *testing.T) {
server, err := serverConfig.NewServer(router)
require.NoError(err)
require.NotNil(server)
assert.Equal(router, server.Handler)

assert.Equal(15*time.Second, server.ReadTimeout)
assert.Equal(27*time.Minute, server.ReadHeaderTimeout)
Expand Down Expand Up @@ -124,7 +123,6 @@ func testServerConfigTLS(t *testing.T) {
server, err := serverConfig.NewServer(router)
require.NoError(err)
require.NotNil(server)
assert.Equal(router, server.Handler)

assert.Equal(72*time.Second, server.ReadTimeout)
assert.Equal(109*time.Minute, server.ReadHeaderTimeout)
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ require (
github.com/spf13/pflag v1.0.5 // indirect
github.com/spf13/viper v1.7.1
github.com/stretchr/testify v1.7.0
github.com/xmidt-org/httpaux v0.1.3
github.com/xmidt-org/httpaux v0.1.6
go.uber.org/dig v1.10.0
go.uber.org/fx v1.13.1
go.uber.org/multierr v1.6.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -202,6 +202,8 @@ github.com/tmc/grpc-websocket-proxy v0.0.0-20190109142713-0ad062ec5ee5/go.mod h1
github.com/xiang90/probing v0.0.0-20190116061207-43a291ad63a2/go.mod h1:UETIi67q53MR2AWcXfiuqkDkRtnGDLqkBTpCHuJHxtU=
github.com/xmidt-org/httpaux v0.1.3 h1:RiA4pCwlZfu6a3CBzbvJy3F+5no1ou2UB2XLmNxzzUs=
github.com/xmidt-org/httpaux v0.1.3/go.mod h1:mviIlg5fHGb3lAv3l0sbiwVG/q9rqvXaudEYxVrzXdE=
github.com/xmidt-org/httpaux v0.1.6 h1:1fK1bNpU2PcufacDkgdmM+1TnIE+mIrRSHz8cfYcCKs=
github.com/xmidt-org/httpaux v0.1.6/go.mod h1:mviIlg5fHGb3lAv3l0sbiwVG/q9rqvXaudEYxVrzXdE=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
go.etcd.io/bbolt v1.3.2/go.mod h1:IbVyRI1SCnLcuJnV2u8VeU0CEYM7e686BmAb1XKL+uU=
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
Expand Down

0 comments on commit 8a452e9

Please sign in to comment.