Skip to content
This repository has been archived by the owner on Mar 17, 2022. It is now read-only.

fix!: prevent req being added twice to the response and request start log #3

Merged
merged 2 commits into from
Mar 15, 2022

Conversation

AdriVanHoudt
Copy link

There is no way to know in the response log event handling if the request was already added through the child bindings in onRequest.
And there was no way as a user to fix this behaviour properly.

So now req will be added once but you need to make sure that you pass it in childBindings for the response.
Request start event will have it regardless but also only once.

This is a breaking change as some people will have removed the req from the childBindings to get around this issue.

Fixes hapijs#91

…rt log

There is no way to know in the response log event handling if the request was already added through the child bindings in `onRequest`.
And there was no way as a user to fix this behaviour properly.

So now `req` will be added once but you need to make sure that you pass it in `childBindings` for the response.
Request start event will have it regardless but also only once.

This is a breaking change as some people will have removed the `req` from the `childBindings` to get around this issue.

Fixes hapijs#91
@AdriVanHoudt AdriVanHoudt self-assigned this Mar 15, 2022
@AdriVanHoudt AdriVanHoudt merged commit 246e907 into Salesflare:master Mar 15, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Req element twitce with hapi.
1 participant