Replace HTTPoison with Finch - #66
Open
gilbertwong96 wants to merge 3 commits into
Open
Conversation
- Swap httpoison dep for finch ~0.19 and bump elixir floor to ~> 1.15 - Start a supervised Finch instance (GeoIP.Finch) in the app supervisor - Replace HTTPoison.get/1 with Finch.build/2 + Finch.request/2 - Map HTTPoison.Response/Error structs to Finch.Response and Finch exceptions - Update mocked tests to stub the Finch boundary
Verified against the v4 migration guide: none of the breaking changes (removed :fallback/:stats/:limit/:nodes options, fetch/4 return change, :ttl -> :expire rename, count/dump/load/set removals) touch the three Cachex call sites in use (Cachex.Spec.expiration/1, Cachex.get/3, Cachex.put/4). Cachex.Spec.expiration/1 is now a Record macro but the require + fully-qualified call form still resolves. Full stack verified via live HTTP + cache round-trip.
Raise elixir floor to ~> 1.16 and align .tool-versions with the local toolchain used for the Finch/Cachex migration.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Swaps the HTTP client from HTTPoison to Finch, and bumps Cachex from 3.x to 4.x.
HTTPoison.get/1withFinch.build/2+Finch.request/2, backed by a supervisedGeoIP.Finchinstance added to the app supervisorHTTPoison.Response/HTTPoison.ErrortoFinch.Responseand Finch exceptions (Finch.Error,Finch.TransportError,Finch.HTTPError, all of which expose:reason)build/2+request/3) returning%Finch.Response{status:, body:}cachex~> 3.3→~> 4.0; verified against the v4 migration guide that none of the breaking changes affect the three Cachex call sites in use (Cachex.Spec.expiration/1,Cachex.get/3,Cachex.put/4)~> 1.16(Finch requires~> 1.15) and align.tool-versionswith Erlang 29 / Elixir 1.20Behavior verified end-to-end against a live local HTTP server (happy path, non-200, non-JSON body, and transport errors), since the
mock/mecktest dep doesn't compile on OTP 29 (pre-existing — meck 0.9.2 uses deprecatedcatchsyntax).HTTPoison 2.x (the pinned version) depends on hackney < 4.0, which is affected by CVE-2026-47075 (HTTP request splitting) and CVE-2026-47066 (DoS). Migrating to Finch drops the hackney dependency entirely.