Skip to content

fix: serialization of []http.Cookie #778

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

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

youta1119
Copy link

Fixes #776

@danielgtaylor danielgtaylor requested a review from Copilot March 29, 2025 17:06
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR fixes the serialization issue for []http.Cookie by skipping header processing for cookie slices. Key changes include:

  • Adding a new field (ShouldSkip) to headerInfo to mark headers that should not be serialized.
  • Introducing a lambda in findHeaders to detect cookie slices and mark them accordingly.
  • Adjusting recursive processing in _findInType to respect the new skip flag.
Comments suppressed due to low confidence (1)

huma.go:413

  • [nitpick] Consider renaming 'resolved' to a more descriptive name such as 'headerFound' to better convey its purpose.
resolved := false

Copy link

codecov bot commented Mar 29, 2025

Codecov Report

Attention: Patch coverage is 83.33333% with 3 lines in your changes missing coverage. Please review.

Project coverage is 93.00%. Comparing base (4977a7a) to head (001826c).
Report is 5 commits behind head on main.

Files with missing lines Patch % Lines
huma.go 83.33% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #778      +/-   ##
==========================================
- Coverage   93.10%   93.00%   -0.11%     
==========================================
  Files          23       23              
  Lines        5296     5301       +5     
==========================================
- Hits         4931     4930       -1     
- Misses        313      317       +4     
- Partials       52       54       +2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

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.

Serialization of []http.Cookie is wrong
1 participant