Skip to content

Add headers request option - #40

Open
baweaver wants to merge 2 commits into
mainfrom
request-headers-option
Open

baweaver wants to merge 2 commits into
mainfrom
request-headers-option

Conversation

@baweaver

@baweaver baweaver commented Oct 29, 2026 •

Copy link
Copy Markdown

Adds a headers option to client requests, so callers can send custom HTTP headers with a check, for example client.check(..., options: { headers: { "X-Example" => "1" } }). When the option is not given, requests are sent exactly as before.

This also fixes CI, which was failing on main for reasons unrelated to this change: ubuntu-latest moved to Ubuntu 26.04, which has no Ruby 3.0 or 3.1 builds, so the job is pinned to ubuntu-24.04. Newer RuboCop releases also flagged three existing lines, which are updated with no behavior change. It is a separate commit, so it can be split out if preferred.

Lets callers send custom HTTP headers with a check request.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI auto review requested due to automatic review settings October 29, 2026 02:41

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟢 Approval recommended

No active review issues are reported for the change adding custom HTTP header support.

No open issues 🎉

What changed in this PR

Adds a headers request option so callers can send custom HTTP headers through the shared client request implementation.

Changes:

  • Reads optional headers and forwards them to Faraday.
  • Adds a check-request test verifying a custom header is sent.
  • Documents the new option in the changelog.
File Description
test/​freno/​client/​requests/​check_test.rb Tests custom header forwarding on a check request.
lib/​freno/​client/​request.rb Stores the headers option and passes it to Faraday.
CHANGELOG.md Announces the new request option.

Review effort: Balanced (auto)

ubuntu-latest now points to Ubuntu 26.04, where ruby/setup-ruby has no
Ruby 3.0 or 3.1 builds. Pin the job to ubuntu-24.04 so the full matrix
keeps testing every Ruby the gemspec supports.

RuboCop's version floats and new cops are enabled, so newer releases
flag existing code. Define the two error classes with the class keyword
(Style/EmptyClassDefinition) and drop redundant parentheses
(Style/RedundantParentheses). Behavior is unchanged.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.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.

2 participants