Skip to content
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

feat: add response headers to HttpException #658

Merged
merged 12 commits into from
Sep 2, 2024
Merged

Conversation

karel-rehor
Copy link
Contributor

@karel-rehor karel-rehor commented Aug 28, 2024

Proposed Changes

  • Add Headers to HttpException
  • Make Headers easily accessible in WriteErrorEvent
  • Add Example showing how to use these changes
  • Add tests of these changes

Checklist

  • CHANGELOG.md updated
  • Rebased/mergeable
  • A test has been added if appropriate
  • dotnet test completes successfully
  • Commit messages are conventional
  • Sign CLA (if not already signed)

@karel-rehor karel-rehor marked this pull request as draft August 29, 2024 07:56
@karel-rehor karel-rehor marked this pull request as ready for review August 29, 2024 08:10
/// <summary>
/// The response headers
/// </summary>
public IEnumerable<HeaderParameter> Headers;
Copy link
Contributor

@alespour alespour Aug 29, 2024

Choose a reason for hiding this comment

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

I do not have a strong opinion on this, but since Headers property in RestResponse class is nullable (T?), I think it should be here too, ie.

Suggested change
public IEnumerable<HeaderParameter> Headers;
public IEnumerable<HeaderParameter>? Headers { get; set; }

And, using a property is more common than a plain field, and follows the style of existing code.
Otherwise good to go after CHANGELOG is updated. The amount of test coverage of the new feature is outstanding.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added as suggested

@alespour alespour self-requested a review August 29, 2024 10:21
Copy link
Contributor

@alespour alespour left a comment

Choose a reason for hiding this comment

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

LGTM now!

Copy link
Contributor

@bednar bednar left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@karel-rehor karel-rehor merged commit f212951 into master Sep 2, 2024
9 checks passed
@karel-rehor karel-rehor deleted the feat/errorHeaders branch September 2, 2024 15:25
@bednar bednar added this to the 4.18.0 milestone Sep 13, 2024
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