Skip to content

feat(image): add support for custom HTTP headers in image requests#2185

Merged
usmanvrtx merged 3 commits intomainfrom
feat/2184-network-image-custom-headers
Apr 6, 2026
Merged

feat(image): add support for custom HTTP headers in image requests#2185
usmanvrtx merged 3 commits intomainfrom
feat/2184-network-image-custom-headers

Conversation

@usmanvrtx
Copy link
Copy Markdown
Contributor

@usmanvrtx usmanvrtx commented Apr 6, 2026

Summary

Add support for custom HTTP headers in network images.

Key Changes

Image Request Handling

  • Enable passing custom HTTP headers (e.g., Authorization) with network image requests.
  • Extend existing image loading logic to include header configuration.
  • Ensure headers are correctly attached to all outgoing image fetch requests.

API Consistency

  • Align network image behavior with standard HTTP request patterns.
  • Avoid ad-hoc workarounds for authenticated or protected image resources.

Code Improvements

  • Refactor request pipeline to support header injection cleanly.
  • Maintain backward compatibility for existing image usage.

Video Demonstration
Watch video

Usage Example

- Image:
    source: https://example.com/image.png
    headers:
      Authorization: "Bearer ${token}"
      X-Custom-Header: "my-custom-value"

@usmanvrtx usmanvrtx requested a review from sharjeelyunus April 6, 2026 08:22
@usmanvrtx usmanvrtx self-assigned this Apr 6, 2026
@usmanvrtx usmanvrtx added the enhancement New feature or request label Apr 6, 2026
@usmanvrtx usmanvrtx linked an issue Apr 6, 2026 that may be closed by this pull request
@TheNoumanDev TheNoumanDev self-requested a review April 6, 2026 11:58
Copy link
Copy Markdown
Member

@TheNoumanDev TheNoumanDev left a comment

Choose a reason for hiding this comment

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

LGTM

@usmanvrtx usmanvrtx merged commit b6388f0 into main Apr 6, 2026
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support Custom HTTP Headers for Network Image Requests

2 participants