这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@youta1119
Copy link

Fixes #776

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

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

@codecov
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.

@KingkorAtMaxint
Copy link

Can this be merged and released please? This is a huge bug and it's stopping us from implement a cookie based authentication. When we try to set multiple cookies using the slices syntax, it's setting the first one as whole. Then it adds another Set-Cookie with all the cookies combined by ,

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

2 participants