Skip to content

fix(http): Reset headers, progress, and statusCode when using set() in HttpResource#62873

Closed
wartab wants to merge 1 commit intoangular:mainfrom
wartab:reset-http-resource
Closed

fix(http): Reset headers, progress, and statusCode when using set() in HttpResource#62873
wartab wants to merge 1 commit intoangular:mainfrom
wartab:reset-http-resource

Conversation

@wartab
Copy link
Copy Markdown
Contributor

@wartab wartab commented Jul 29, 2025

Currently, those values aren't reset, which means they are out of sync with the new value

This change is slightly opinionated, but it does seem appropriate to me.

PR Checklist

Please check if your PR fulfills the following requirements:

PR Type

What kind of change does this PR introduce?

  • Bugfix
  • Feature
  • Code style update (formatting, local variables)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • CI related changes
  • Documentation content changes
  • angular.dev application / infrastructure changes
  • Other... Please describe:

What is the current behavior?

Previous headers, progress, and statusCode are kept.

Issue Number: N/A

What is the new behavior?

They are reset when setting a custom value.

Does this PR introduce a breaking change?

  • Yes
  • If you relied on this undefined behaviour, yes.
  • No

Other information

Ran into this by accident when checking only for statusCode() without checking for the actual status().

… in `HttpResource`

Currently, those values aren't reset, which means they are out of sync with the new value
@pullapprove pullapprove bot requested a review from thePunderWoman July 29, 2025 14:14
@angular-robot angular-robot bot added the area: common/http Issues related to HTTP and HTTP Client label Jul 29, 2025
@ngbot ngbot bot added this to the Backlog milestone Jul 29, 2025
@thePunderWoman thePunderWoman requested review from alxhub and removed request for thePunderWoman July 29, 2025 17:30
Copy link
Copy Markdown
Member

@alxhub alxhub left a comment

Choose a reason for hiding this comment

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

This LGTM, but needs a TGP just to be on the safe side.

@alxhub alxhub added the requires: TGP This PR requires a passing TGP before merging is allowed label Jul 30, 2025
@pullapprove pullapprove bot removed the requires: TGP This PR requires a passing TGP before merging is allowed label Jul 30, 2025
@JeanMeche
Copy link
Copy Markdown
Member

I'll take care of the TGP tomorrow.

@JeanMeche
Copy link
Copy Markdown
Member

TGP is "green"

@JeanMeche JeanMeche added action: merge The PR is ready for merge by the caretaker target: patch This PR is targeted for the next patch release labels Jul 31, 2025
thePunderWoman pushed a commit that referenced this pull request Aug 1, 2025
… in `HttpResource` (#62873)

Currently, those values aren't reset, which means they are out of sync with the new value

PR Close #62873
@thePunderWoman
Copy link
Copy Markdown
Contributor

This PR was merged into the repository by commit e5d6fb5.

The changes were merged into the following branches: main, 20.1.x

@angular-automatic-lock-bot
Copy link
Copy Markdown

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 Sep 1, 2025
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 target: patch This PR is targeted for the next patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants