Skip to content

Fixes issue with handling multiple headers with same name in DevToolsPlugin. Closes #1169 #1170

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

waldekmastykarz
Copy link
Collaborator

Fixes issue with handling multiple headers with same name in DevToolsPlugin. Closes #1169

@waldekmastykarz waldekmastykarz requested a review from a team as a code owner May 10, 2025 17:36
@waldekmastykarz waldekmastykarz added the pr-bugfix Fixes a bug label May 10, 2025
@garrytrinder garrytrinder requested a review from Copilot May 12, 2025 09:32
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 handling of multiple headers with the same name in DevToolsPlugin by grouping duplicate headers and joining their values with a comma.

  • Replaces creating a dictionary from header list with grouping by header name.
  • Applies this grouping logic to both the request and response header processing.
Comments suppressed due to low confidence (2)

dev-proxy-plugins/Inspection/DevToolsPlugin.cs:244

  • Ensure that joining header values with a comma does not introduce ambiguity if individual header values contain commas. Consider verifying if downstream consumers expect a single concatenated string or require an array of header values.
ToDictionary(g => g.Key, g => string.Join(", ", g.Select(h => h.Value)));

dev-proxy-plugins/Inspection/DevToolsPlugin.cs:244

  • Confirm that the aggregated header values using a comma as a delimiter align with how header data is consumed elsewhere in the system. If not, consider alternative approaches to maintain clear separations between multiple header values.
ToDictionary(g => g.Key, g => string.Join(", ", g.Select(h => h.Value)));

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pr-bugfix Fixes a bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: An item with the same key has already been added. Key: Set-Cookie
2 participants