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

Changes to header parsing #3672

Merged
merged 7 commits into from
Sep 19, 2024
Merged

Conversation

bleaphar
Copy link
Contributor

This PR fixes the issue with trying to get values from the headers of an http response. It looks to see if the user has a path of four, assuming they want the first element in the list and if there's a path of five then it gets the first element in the list that matches the value of the string. Additionally, a test for this scenario is included.

Co-authored-by: Jon Sequeira <jonsequeira@gmail.com>
Copy link
Contributor

@shyamnamboodiripad shyamnamboodiripad left a comment

Choose a reason for hiding this comment

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

Lgtm modulo comments


var returnValue = secondResult.Events.OfType<ReturnValueProduced>().First();

var response = (HttpResponse)returnValue.Value;
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't looks like returnValue or response are needed.


var returnValue = secondResult.Events.OfType<ReturnValueProduced>().First();

var response = (HttpResponse)returnValue.Value;
Copy link
Contributor

Choose a reason for hiding this comment

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

It doesn't looks like returnValue or response are needed.

{
var response = new HttpResponseMessage(HttpStatusCode.OK);
response.RequestMessage = message;
var contentString = @"
Copy link
Contributor

Choose a reason for hiding this comment

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

Using a raw string (""") will improve readability.

@jonsequitur jonsequitur enabled auto-merge (squash) September 19, 2024 17:55
@jonsequitur jonsequitur merged commit 3dc0d11 into dotnet:main Sep 19, 2024
4 checks passed
@colombod colombod added the Area-HTTP HttpKernel, Visual Studio HTTP Editor label Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area-HTTP HttpKernel, Visual Studio HTTP Editor
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants