Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from

Conversation

wartab
Copy link
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
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
Member

I'll take care of the TGP tomorrow.

@JeanMeche
Copy link
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
Contributor

This PR was merged into the repository by commit e5d6fb5.

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
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