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

Connection reset when posting data to ssl status route #59

Open
ckoopmann opened this issue Jul 30, 2020 · 0 comments
Open

Connection reset when posting data to ssl status route #59

ckoopmann opened this issue Jul 30, 2020 · 0 comments

Comments

@ckoopmann
Copy link

ckoopmann commented Jul 30, 2020

When posting data to the 'status/{status_code}' route on the ssl version it fails with a connection reset. This happens neither on the local http server nor on the remote https://httpbin.org (see example), nor when sending a post request without data payload.

Therefore it seems to deviate from the behaviour of httpbin.org which is probably unintended.

import requests
from pytest_httpbin.certs import where
test_data = {'foo': 'bar'}
status_route = '/status/200'

# Fails with requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
def test_post_data_to_status_route_ssl(httpbin_secure):
    url = httpbin_secure.url
    response = requests.post(url + status_route, verify=where(), data=test_data)
    assert response.status_code == 200

# Passes
def test_post_without_data_to_status_route(httpbin):
    url = httpbin.url
    response = requests.post(url + status_route)
    assert response.status_code == 200

# Passes
def test_post_data_to_status_route(httpbin):
    url = httpbin.url
    response = requests.post(url + status_route, data=test_data)
    assert response.status_code == 200

# Passes
def test_post_data_to_status_route_ssl_remote_httpbin():
    url = "https://httpbin.org"
    response = requests.post(url + status_route, data=test_data)
    assert response.status_code == 200

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

No branches or pull requests

1 participant