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

Expose network context to requestHook & responseHook scopes #2662

Merged

Conversation

jgiovaresco
Copy link
Contributor

The issue #2012 was talking about exposing the network context to the responseHook scope to be able to send new request from there.

I took the opportunity to expose the network context to the requestHook also to be able to send request in request hook. Personally I am interested by this to create a plugin to login automatically to a private api. If you prefer I can move the commit in another PR ;)

Closes #2012

@develohpanda develohpanda self-requested a review September 24, 2020 23:37
@jgiovaresco
Copy link
Contributor Author

Documentation should be updated (https://support.insomnia.rest/article/26-plugins#context.response / https://support.insomnia.rest/article/26-plugins#context.request) but I don't know how to update it 😅

I've noticed inconsistency on naming between `_applyRequestPluginHooks` and `_applyResponsePluginHooks` parameters.
@jgiovaresco jgiovaresco force-pushed the fix/2012-expose-network-context branch from c370863 to 76590b2 Compare September 25, 2020 05:45
Copy link
Contributor

@develohpanda develohpanda left a comment

Choose a reason for hiding this comment

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

Looks good to me 👍

What part of the documentation needs to be updated? Docs are hosted on HelpScout for various reasons, but if you post a diff/changes into a comment here I can go ahead and update HelpScout with it. (I don't think there are any changes required but I might be missing something)

@develohpanda develohpanda merged commit 64c7b42 into Kong:develop Sep 29, 2020
@jgiovaresco jgiovaresco deleted the fix/2012-expose-network-context branch December 2, 2020 16:44
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.

[Improvement] Plugin API to send new request in response hook
2 participants