Skip to content

Upgrade hackney 4.5.2#154

Open
cbecker wants to merge 3 commits into
elixir-waffle:masterfrom
cbecker:upgrade-hackney-4.5.2
Open

Upgrade hackney 4.5.2#154
cbecker wants to merge 3 commits into
elixir-waffle:masterfrom
cbecker:upgrade-hackney-4.5.2

Conversation

@cbecker

@cbecker cbecker commented Jul 15, 2026

Copy link
Copy Markdown

Checklist

  • I confirm that all text in the PR description, commit messages, code comments, and documentation is human-authored.
    (Some comments AI authored, but reviewed by myself)

Description

Second take at upgrading Hackney to 4.5.2. First take was #147

I did not expect such complexity to use Hackney 4.x correctly.
The issues arise because we need to support async mode to honor max body length, and we need to handle redirects ourselves.
May be worth using another HTTP library, but well, here it is in case @achempion it works for you.
I want to be able to upgrade hackney and waffle is blocking me.

What happened in this PR:

  • Revamped Waffle.HTTPClient behavior
  • Rewritten the Hackney http client to support max body length parameter, using Hackney's async API
  • Added content disposition module and tests
  • Fixed tests

Discussion

I wonder if we want to keep Hackney, given this increase in complexity.

A few options:

  1. (breaking change) Remove option to fetch File from URL. The user can do it themselves as needed, with any lib they use in their project.
  2. Use Finch, Req, or another client

I'd rather do (1) and let the user handle it.

@achempion

Copy link
Copy Markdown
Member

Thank you for the exploration. Yeah, the new surface is quite wide.

I think the right approach would be moving to a different http client, so Waffle still provides protection on redirects and max file size.

@cbecker

cbecker commented Jul 15, 2026

Copy link
Copy Markdown
Author

Thank you for the exploration. Yeah, the new surface is quite wide.

I think the right approach would be moving to a different http client, so Waffle still provides protection on redirects and max file size.

What about removing the fetch functionality? Is this something needed? As I said in the comments, it's very easy for the user to fetch with whatever library they want. I am not sure it's best to be waffle's responsibility to provide it.

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.

3 participants