Skip to content

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

Merged
waldekmastykarz merged 3 commits intodotnet:mainfrom
waldekmastykarz:fix-chromedevtools-headers
May 13, 2025
Merged

Fixes issue with handling multiple headers with same name in DevToolsPlugin. Closes #1169#1170
waldekmastykarz merged 3 commits intodotnet:mainfrom
waldekmastykarz:fix-chromedevtools-headers

Conversation

@waldekmastykarz
Copy link
Copy Markdown
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
Copy Markdown
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 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)));

@waldekmastykarz waldekmastykarz enabled auto-merge (squash) May 13, 2025 05:32
@waldekmastykarz waldekmastykarz merged commit 54ecda9 into dotnet:main May 13, 2025
4 checks passed
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

3 participants