Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: refactor requestContextPlugin.spec.js to use response headers #176

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

shawshankkumar
Copy link

@shawshankkumar shawshankkumar commented Dec 18, 2023

Fixes #175

I replaced the json body with value in headers. I found this to be the best approach. if anyone has any better solutions, happy to implement that as well.

Checklist

@alfonsograziano
Copy link
Contributor

#177 is a possible alternative approach. Not sure what is the best one :)

reply.status(204).send({
storedValue,
})
reply.status(204).header('storedvalue', storedValue).send()
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The solution LGTM
I preferred the #177 because the 204 status code was not necessary to make the module work, so it was adding confusion and it is better to remove it instead.

If you would like to update this PR adding an clear test such the plugin must keep the context across 20x requests it would be best!

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, so something like the plugin must keep the context across 204 requests => then use the headers in a separate case? @Eomm

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i have added a new case, does it make sense? what changes would you recommend 🤔 ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

CI seems to be failing
3 participants