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

Update default HTTP status code expectation #376

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

kvanderkamp
Copy link

This PR changes how the expect argument works. Before, it only accepted port 200 if no expect argument was given, and it would fail if the response port was different. This was a problem when the server returned valid ports like 204 or 304, which mean no content or not modified.

Now, the default behavior is to accept ports 200-299 and 304. The client will only fail if the response port is not in this list or range. This makes the client more flexible to handle different kinds of successful responses.

@bahmutov
Copy link
Owner

bahmutov commented Sep 9, 2024

Why change it? You already can use the expected status code argument...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants