-
-
Notifications
You must be signed in to change notification settings - Fork 734
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
Remove body
argument to header functions
#1542
Comments
If this is undocumented and untested, I’d be okay to remove it without a breaking change. If it breaks someone’s code it’s fair play to say it was never documented / tested ¯\_(ツ)_/¯ Documenting it as breaking change is going the extra mile. Go if you like, but I don’t feel like we have to |
It is tested and documented – just not useful! Like many of the tests, the intention of the test (which I changed in #1541) was not quite clear, and I can't say it left me confident someone intended to pass the response body to the callback, vs the test containing a bug. The behavior is documented, ambiguously:
|
Oops! I accidentally pushed this branch and it let me. I stopped the Travis builld which should prevent the release, though I can't force push because of branch protection. Should I turn it off temporarily and force push the commit before? Can we turn on branch protection so I can try to prevent a repeat performance? 😝 |
Sure, go ahead 👍 |
Okay, done. I can't find an option to prevent accidentally pushing to the branch. I can be careful… though I'd rather find a way to do that. Am I missing something? Is it only possible to do that if "Include administrators" is checked? I can try to be more careful about it… |
Huh, there's a test that's failing in #1544. In this one it's super clear that the response body is intended to be passed to the header function. nock/tests/test_default_reply_headers.js Lines 46 to 66 in 560a5d8
Before removing this, I want to see if I can find any more information about why this use case was added. I'm still inclined to remove it as it seems very specific and something that can be accomplished around in other ways. |
🎉 This issue has been resolved in version 11.0.0-beta.16 🎉 The release is available on: Your semantic-release bot 📦🚀 |
🎉 This issue has been resolved in version 11.0.0 🎉 The release is available on: Your semantic-release bot 📦🚀 |
Currently the third argument to header functions receives a buffer containing the response body. I can't think of a reason why this would be helpful.
I could imagine the request body being helpful, though that should be accessible from the request.
I'm inclined to remove this parameter from the function in a breaking change.
See #1541 where I added a test covering the current behavior.
The text was updated successfully, but these errors were encountered: