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

Fix admin requests with empty body to avoid response code 411 #1738

Merged
merged 2 commits into from
Sep 11, 2023

Conversation

danielimre
Copy link
Contributor

@danielimre danielimre commented Dec 13, 2021

Changed admin client to add empty response entity for HTTP requests without body to have proper Content-Length header set in every case. Closes #1729

@danielimre
Copy link
Contributor Author

I haven't added any extra tests as all of these scenarios are already exercised in the acceptance tests.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

IMHO it is still valid

@oleg-nenashev oleg-nenashev added the needs-tom Tom's Train Project :) label May 6, 2023
@tomakehurst
Copy link
Member

Think we still need a test case for this. Although this code is exercised generally by the acceptance tests, there's nothing that produces the problem this is attempting to fix.

@oleg-nenashev
Copy link
Member

@danielimre are you still interested in this pull request?

@danielimre
Copy link
Contributor Author

@oleg-nenashev sure. Let me check if I can create a reasonable test for this.

@danielimre
Copy link
Contributor Author

@oleg-nenashev I've put together some tests backing the changes. The simplest solution I've found without doing anything HTTP client specific stuff is to make use of wiremock itself to verify the behavior.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

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

Thanks for adding the test coverage!

@oleg-nenashev oleg-nenashev merged commit 8c07749 into wiremock:master Sep 11, 2023
7 checks passed
@oleg-nenashev
Copy link
Member

Thanks @danielimre!

@danielimre danielimre deleted the issue-1729 branch September 21, 2023 09:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug needs-tom Tom's Train Project :)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

WireMock admin client reset fails with 411 through some proxies
3 participants