summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorValery Piashchynski <[email protected]>2020-03-26 20:17:51 +0300
committerValery Piashchynski <[email protected]>2020-03-26 20:17:51 +0300
commit71b3f02ae3746f49e83760cd0430c9983919d3c8 (patch)
tree2f00b9d501e5f6fec3a392f9a2fdf996cedce466 /service
parent58f10f257be50d95e6b227d99d35a3655b878847 (diff)
Typo fix
Diffstat (limited to 'service')
-rw-r--r--service/headers/service_test.go33
1 files changed, 33 insertions, 0 deletions
diff --git a/service/headers/service_test.go b/service/headers/service_test.go
index e8d143d8..3ccea21b 100644
--- a/service/headers/service_test.go
+++ b/service/headers/service_test.go
@@ -110,6 +110,39 @@ func Test_ResponseHeaders(t *testing.T) {
bkoff.MaxElapsedTime = time.Second * 15
err := backoff.Retry(func() error {
+ logger, _ := test.NewNullLogger()
+ logger.SetLevel(logrus.DebugLevel)
+
+ c := service.NewContainer(logger)
+ c.Register(rrhttp.ID, &rrhttp.Service{})
+ c.Register(ID, &Service{})
+
+ assert.NoError(t, c.Init(&testCfg{
+ headers: `{"response":{"output": "output-header"},"request":{"input": "custom-header"}}`,
+ httpCfg: `{
+ "enable": true,
+ "address": ":6079",
+ "maxRequestSize": 1024,
+ "workers":{
+ "command": "php ../../tests/http/client.php header pipes",
+ "relay": "pipes",
+ "pool": {
+ "numWorkers": 1,
+ "allocateTimeout": 10000000,
+ "destroyTimeout": 10000000
+ }
+ }
+ }`}))
+
+ go func() {
+ err := c.Serve()
+ if err != nil {
+ t.Errorf("error during the Serve: error %v", err)
+ }
+ }()
+ time.Sleep(time.Millisecond * 100)
+ defer c.Stop()
+
req, err := http.NewRequest("GET", "http://localhost:6079?hello=value", nil)
if err != nil {
return err