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

afterResponse hook not being triggered #159

Open
renataogarcia opened this issue Apr 29, 2022 · 1 comment
Open

afterResponse hook not being triggered #159

renataogarcia opened this issue Apr 29, 2022 · 1 comment

Comments

@renataogarcia
Copy link

After upgrading to 5.1 the afterResponse hook is no longer being triggered. The beforeRequest works fine.

It seems that 5.1 introduced this change where it is always using streams and as per got docs the afterResponse is ignored when using streams.

@alexghr
Copy link
Owner

alexghr commented May 4, 2022

Hi @renataogarcia, I see what you mean. We could check if the request body is a stream and switch between got's streaming API and classic API to restore the hook functionality. I

think this could work if we wrap the response body in a stream in GotResponse if the calling code requests the body as a stream.

I'll give this a try.

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

No branches or pull requests

2 participants