Skip to content

Fix error message about content-types#775

Merged
jhump merged 1 commit intomainfrom
jh/fix-error-message
Sep 13, 2024
Merged

Fix error message about content-types#775
jhump merged 1 commit intomainfrom
jh/fix-error-message

Conversation

@jhump
Copy link
Member

@jhump jhump commented Sep 13, 2024

The error message had a copy+pasta bug where it was showing the wrong prefix. This resulted in possibly very confusing error message where it complained that the content-type was wrong, but then said it was expecting exactly what it actually got.

Signed-off-by: Josh Humphries <2035234+jhump@users.noreply.github.com>
@jhump jhump force-pushed the jh/fix-error-message branch from 61f0f7c to 2358f3a Compare September 13, 2024 14:46
Comment on lines +171 to +172
// We never setup a request body, so it's effectively already closed.
// So nothing else to do.
Copy link
Member Author

@jhump jhump Sep 13, 2024

Choose a reason for hiding this comment

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

Unrelated, but I was reading this code and confused at first why it does nothing to close the body. And it's because we haven't set one yet: if d.requestSent is false then the request body is still http.NoBody. So I added a comment for future me :)

@jhump jhump merged commit 99d6b9c into main Sep 13, 2024
@jhump jhump deleted the jh/fix-error-message branch September 13, 2024 17:33
@jhump jhump added the bug Something isn't working label Sep 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants