puzpuzpuz / cls-rtracer

Request Tracer - CLS-based request id generation for Express, Fastify, Koa and Hapi, batteries included
MIT License
311 stars 24 forks source link

feat(koa): echo header in response #41

Closed pyrho closed 4 years ago

pyrho commented 4 years ago

Setting echoHeader: true in the koaMiddleware options will inject the header (respecting headerName) in the response headers.

Relates to #1

pyrho commented 4 years ago

Oops my prettier config did some cosmetic changes, I will amend it.

edit: amended.

puzpuzpuz commented 4 years ago

@pyrho the changes look good to me. The only problem is that I'd like to keep the same feature set across all middlewares/plugins. Is it too much to ask you to implement echoHeader support for other frameworks?

pyrho commented 4 years ago

The only problem is that I'd like to keep the same feature set across all middlewares/plugins.

I agree that this would be the ideal situation.

Is it too much to ask you to implement echoHeader support for other frameworks?

In an absolute way, definitely not too much to ask. In a relative way, I've got to chose my battles against time and I am not using any of the other two frameworks.

So I'll put that on my todo list but don't hold your breath (:

puzpuzpuz commented 4 years ago

In an absolute way, definitely not too much to ask. In a relative way, I've got to chose my battles against time and I am not using any of the other two frameworks.

So I'll put that on my todo list but don't hold your breath (:

That makes sense. I've merged your PR into a feature/echo-header branch, which will accumulate changes necessary for the complete feature. Many thanks for your contribution!