Skip to content

Conversation

@drish
Copy link
Collaborator

@drish drish commented Nov 16, 2025

Summary by cubic

Adds a new Resend::Response wrapper that exposes HTTP response headers while keeping existing hash-style access fully compatible. Enables reading rate limit, request ID, and other metadata from API responses.

  • New Features
    • All API calls now return Resend::Response, which behaves like a Hash and adds a headers accessor (keys normalized to lowercase).
    • Request extracts and normalizes headers; no breaking changes to existing usage.
    • Added headers example and tests for headers access and backward compatibility.

Written for commit e1ed093. Summary will update automatically on new commits.

@drish drish requested a review from gabrielmfern November 17, 2025 13:36
@drish drish marked this pull request as ready for review November 17, 2025 13:36
Copy link
Contributor

@cubic-dev-ai cubic-dev-ai bot left a comment

Choose a reason for hiding this comment

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

1 issue found across 6 files

Prompt for AI agents (all 1 issues)

Understand the root cause of the following 1 issues and fix them.


<file name="lib/resend/request.rb">

<violation number="1" location="lib/resend/request.rb:40">
Wrapping the HTTParty response with Resend::Response drops the entire response body because the wrapper only keeps data when it receives an actual Hash; HTTParty::Response fails the is_a?(Hash) check, so every call now returns an empty hash instead of the API payload. Ensure the wrapper receives the parsed hash data before instantiating it.</violation>
</file>

Reply to cubic to teach it or ask questions. Re-run a review with @cubic-dev-ai review this PR

@drish drish merged commit 33b2553 into main Dec 12, 2025
9 checks passed
@drish drish deleted the feat/headers branch December 12, 2025 14:57
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