Skip to content

Fix pattern matching in do_latest_file_size_by_head#162

Open
mattwynne wants to merge 1 commit intolau:masterfrom
mechanical-orchard:fix-not-using-head-for-size-pattern-match-bug
Open

Fix pattern matching in do_latest_file_size_by_head#162
mattwynne wants to merge 1 commit intolau:masterfrom
mechanical-orchard:fix-not-using-head-for-size-pattern-match-bug

Conversation

@mattwynne
Copy link

Fix where pattern matching expected a flat 3-tuple {tag, status, headers} but HTTPClient behaviour returns nested structure {:ok, {status, headers}}.

This causes a FunctionClauseError when calling latest_file_size_by_head, silently falling back to GET requests.

Adds Sham (and Bandit) as test-only deps to allow for testing the change.

Licensing: This contribution is made by employees of Mechanical Orchard, Inc. under the terms of the project’s license.

Fix where pattern matching expected a flat
3-tuple {tag, status, headers} but HTTPClient behaviour
returns nested structure {:ok, {status, headers}}.

This causes a FunctionClauseError when calling
latest_file_size_by_head, silently falling back to GET requests.

Adds sham to allow for testing

Co-authored-by: Ryan Spore <ryan@mechanical-orchard.com>
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.

1 participant