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

Responses dropped by middlewares are not registered #221

Open
Fadarrizz opened this issue Mar 3, 2024 · 1 comment
Open

Responses dropped by middlewares are not registered #221

Fadarrizz opened this issue Mar 3, 2024 · 1 comment
Assignees
Labels
bug Something isn't working

Comments

@Fadarrizz
Copy link

Firstly, I really like this package. Really nice work!

In my app, I want to act based on the fact if the ExecuteJavascriptMiddleware drops a response.

However, this is not registered anywhere besides info logging, resulting in an empty array of items without an exception or event raised.

After digging in, I saw the Downloader class doesn't do anything when noticing a dropped response by a middleware (Downloader.php, line 131-137):

        ...
        foreach ($this->middleware as $middleware) {
            $response = $middleware->handleResponse($response);

            if ($response->wasDropped()) {
                return;
            }
        }
       ...

Shouldn't this dispatch a ResponseDropped event or something else?

I'm willing to provide a PR if we can figure out a solution.

Thanks for the help!

@Fadarrizz Fadarrizz added the bug Something isn't working label Mar 3, 2024
@ksassnowski
Copy link
Contributor

You're right, this is a bug. Thanks for pointing this out!

I will fix this in a future version since there are other things around the ResponseDropped event that aren't working as intended at the moment.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants