Skip to content

Conversation

@SkyZeroZx
Copy link
Contributor

@SkyZeroZx SkyZeroZx commented Jun 27, 2025

Currently, Angular's httpResource doesn't expose the redirect and mode options from the underlying Fetch API.
Exposing these options would allow developers to control cross-origin behavior and redirect handling more explicitly, enabling better compliance with security policies and improving integration with external APIs.

Example new usage :

httpResource(() => ({
  url: '/api/register',
  method: 'POST',
  mode: 'cors',
  redirect: 'follow'
}));

This commit adds support for the Fetch API's mode & redirect options when using httpResource with the withFetch provider
@pullapprove pullapprove bot requested a review from crisbeto June 27, 2025 13:58
@angular-robot angular-robot bot added detected: feature PR contains a feature commit area: common/http Issues related to HTTP and HTTP Client labels Jun 27, 2025
@ngbot ngbot bot added this to the Backlog milestone Jun 27, 2025
Copy link
Contributor

@thePunderWoman thePunderWoman left a comment

Choose a reason for hiding this comment

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

LGTM!

reviewed-for: fw-general, public-api

@thePunderWoman thePunderWoman added the target: minor This PR is targeted for the next minor release label Jun 27, 2025
Copy link
Member

@crisbeto crisbeto left a comment

Choose a reason for hiding this comment

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

Reviewed-for: public-api

@thePunderWoman thePunderWoman added the action: merge The PR is ready for merge by the caretaker label Jun 27, 2025
@thePunderWoman
Copy link
Contributor

This PR was merged into the repository by commit 27b7ec0.

The changes were merged into the following branches: main

AndrewKushnir added a commit to AndrewKushnir/angular that referenced this pull request Jun 27, 2025
AndrewKushnir added a commit to AndrewKushnir/angular that referenced this pull request Jun 27, 2025
@angular-automatic-lock-bot
Copy link

This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.

Read more about our automatic conversation locking policy.

This action has been performed automatically by a bot.

@angular-automatic-lock-bot angular-automatic-lock-bot bot locked and limited conversation to collaborators Jul 28, 2025
@SkyZeroZx SkyZeroZx deleted the add-mode-redirect-httpResource branch December 17, 2025 21:28
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

action: merge The PR is ready for merge by the caretaker area: common/http Issues related to HTTP and HTTP Client detected: feature PR contains a feature commit target: minor This PR is targeted for the next minor release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants