roadrunner-server / roadrunner-plugins

📦 Home for the roadrunner plugins
MIT License
25 stars 9 forks source link

[🐛 BUG]: newrelic plugin removes/modifies more headers than it should #185

Closed arku31 closed 2 years ago

arku31 commented 2 years ago

No duplicates 🥲.

What happened?

If you are enabling new_relic plugin, it removes f.e. Content-type

Before enabling:

Content-Type: application/json

After enabling:

Content-Type: text/plain; charset=utf-8

The only change I do is adjusting configuration from

middleware: [ ]

to

middleware: [ "new_relic" ]

Version

2.6.3

Relevant log output

No response

arku31 commented 2 years ago

Sample configuration

  listen: tcp://0.0.0.0:6001

server:
  command: "php public/worker.php"

http:
  address: "0.0.0.0:8081"
  access_logs: false
  middleware: [ "new_relic" ]
  new_relic:
    app_name: "RR"
    license_key: "1234567890123456789012345678901234567890"
  pool:
    debug: false
    max_worker_memory: 1280
    max_jobs: 1000

default worker can be used with this body

        $response = new Psr7\Response(200, [], 'Hello RoadRunner!');
        $response = $response->withHeader('Content-type', 'application/json');
        $psr7->respond($response);

without plugin:

curl -i http://localhost:8081/
HTTP/1.1 200 OK
Content-Type: application/json
Date: Wed, 29 Dec 2021 13:49:56 GMT
Content-Length: 17

with plugin:

curl -i http://localhost:8081/
HTTP/1.1 200 OK
Date: Wed, 29 Dec 2021 13:49:38 GMT
Content-Length: 17
Content-Type: text/plain; charset=utf-8