Skip to content

Writes empty files when using sink #82

Closed

Description

@shadowhand

Whenever I use this middleware when combined with the sink option empty files are written:

$client->get($uri, ['sink' => "$dir/$uri"]);

The file $dir/$uri is created but has no content.

Activity

  1. Kevinrob commented on Jul 1, 2017

    @Kevinrob
    Owner

    Are you sure that this is this middleware that cause the issue?
    The sink option is handled before this middleware.

    Can you share/post your code?

  2. shadowhand commented on Jul 5, 2017

    @shadowhand
    Author

    Yes, I've confirmed that sink works correctly when this middleware is disabled.

    Guzzle config is here and here is our calling code, which is currently not using sink due to this issue.

  3. samwilson commented on Jan 7, 2021

    @samwilson

    We're also seeing this issue in this project. The workaround of not using sink (and instead writing the response body out to a file after the Guzzle request) seems to work fine.

  4. added a commit that references this issue on Mar 9, 2026
    288172c
  5. Kevinrob commented on Mar 9, 2026

    @Kevinrob
    Owner

    Can you review this PR #217 for fixing this issue?

  6. Kevinrob commented on Mar 11, 2026

    @Kevinrob
    Owner

    Available in v8.0.0-RC1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions