Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/proxies.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ If you use proxies, keep in mind that the `httpcore` package only supports proxi

The `httpcore` package also supports proxies using the SOCKS5 protocol.

Make sure to install the optional dependancy using `pip install 'httpcore[socks]'`.
Make sure to install the optional dependency using `pip install 'httpcore[socks]'`.

The `SOCKSProxy` class should be using instead of a standard connection pool:

Expand Down
2 changes: 1 addition & 1 deletion httpcore/_async/connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def _assign_requests_to_connections(self) -> list[AsyncConnectionInterface]:
Called whenever a new request is added or removed from the pool.

Any closing connections are returned, allowing the I/O for closing
those connections to be handled seperately.
those connections to be handled separately.
"""
closing_connections = []

Expand Down
2 changes: 1 addition & 1 deletion httpcore/_sync/connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def _assign_requests_to_connections(self) -> list[ConnectionInterface]:
Called whenever a new request is added or removed from the pool.

Any closing connections are returned, allowing the I/O for closing
those connections to be handled seperately.
those connections to be handled separately.
"""
closing_connections = []

Expand Down
12 changes: 6 additions & 6 deletions tests/_async/test_connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ async def test_connection_pool_with_keepalive():
async with httpcore.AsyncConnectionPool(
network_backend=network_backend, max_keepalive_connections=1
) as pool:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
async with pool.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in pool.connections]
assert info == [
Expand Down Expand Up @@ -126,7 +126,7 @@ async def test_connection_pool_with_close():
)

async with httpcore.AsyncConnectionPool(network_backend=network_backend) as pool:
# Sending an intial request, which once complete will not return to the pool.
# Sending an initial request, which once complete will not return to the pool.
async with pool.stream(
"GET", "https://example.com/", headers={"Connection": "close"}
) as response:
Expand Down Expand Up @@ -183,7 +183,7 @@ async def test_connection_pool_with_http2():
async with httpcore.AsyncConnectionPool(
network_backend=network_backend,
) as pool:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
response = await pool.request("GET", "https://example.com/")
assert response.status == 200
assert response.content == b"Hello, world!"
Expand Down Expand Up @@ -237,7 +237,7 @@ async def test_connection_pool_with_http2_goaway():
async with httpcore.AsyncConnectionPool(
network_backend=network_backend,
) as pool:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
response = await pool.request("GET", "https://example.com/")
assert response.status == 200
assert response.content == b"Hello, world!"
Expand Down Expand Up @@ -471,7 +471,7 @@ async def test_connection_pool_with_immediate_expiry():
keepalive_expiry=0.0,
network_backend=network_backend,
) as pool:
# Sending an intial request, which once complete will not return to the pool.
# Sending an initial request, which once complete will not return to the pool.
async with pool.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in pool.connections]
assert info == [
Expand Down Expand Up @@ -504,7 +504,7 @@ async def test_connection_pool_with_no_keepalive_connections_allowed():
async with httpcore.AsyncConnectionPool(
max_keepalive_connections=0, network_backend=network_backend
) as pool:
# Sending an intial request, which once complete will not return to the pool.
# Sending an initial request, which once complete will not return to the pool.
async with pool.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in pool.connections]
assert info == [
Expand Down
6 changes: 3 additions & 3 deletions tests/_async/test_http_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ async def test_proxy_forwarding():
max_connections=10,
network_backend=network_backend,
) as proxy:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
async with proxy.stream("GET", "http://example.com/") as response:
info = [repr(c) for c in proxy.connections]
assert info == [
Expand Down Expand Up @@ -92,7 +92,7 @@ async def test_proxy_tunneling():
proxy=Proxy("http://localhost:8080/"),
network_backend=network_backend,
) as proxy:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
async with proxy.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in proxy.connections]
assert info == [
Expand Down Expand Up @@ -184,7 +184,7 @@ async def test_proxy_tunneling_http2():
network_backend=network_backend,
http2=True,
) as proxy:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
async with proxy.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in proxy.connections]
assert info == [
Expand Down
6 changes: 3 additions & 3 deletions tests/_async/test_socks_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ async def test_socks5_request():
proxy=httpcore.Proxy("socks5://localhost:8080/"),
network_backend=network_backend,
) as proxy:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
async with proxy.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in proxy.connections]
assert info == [
Expand Down Expand Up @@ -91,7 +91,7 @@ async def test_authenticated_socks5_request():
),
network_backend=network_backend,
) as proxy:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
async with proxy.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in proxy.connections]
assert info == [
Expand Down Expand Up @@ -171,7 +171,7 @@ async def test_socks5_request_failed_to_provide_auth():
async def test_socks5_request_incorrect_auth():
"""
Attempt to send an HTTP request via an authenticated SOCKS proxy,
wit incorrect authentication credentials.
with incorrect authentication credentials.
"""
network_backend = httpcore.AsyncMockBackend(
[
Expand Down
12 changes: 6 additions & 6 deletions tests/_sync/test_connection_pool.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ def test_connection_pool_with_keepalive():
with httpcore.ConnectionPool(
network_backend=network_backend, max_keepalive_connections=1
) as pool:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
with pool.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in pool.connections]
assert info == [
Expand Down Expand Up @@ -126,7 +126,7 @@ def test_connection_pool_with_close():
)

with httpcore.ConnectionPool(network_backend=network_backend) as pool:
# Sending an intial request, which once complete will not return to the pool.
# Sending an initial request, which once complete will not return to the pool.
with pool.stream(
"GET", "https://example.com/", headers={"Connection": "close"}
) as response:
Expand Down Expand Up @@ -183,7 +183,7 @@ def test_connection_pool_with_http2():
with httpcore.ConnectionPool(
network_backend=network_backend,
) as pool:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
response = pool.request("GET", "https://example.com/")
assert response.status == 200
assert response.content == b"Hello, world!"
Expand Down Expand Up @@ -237,7 +237,7 @@ def test_connection_pool_with_http2_goaway():
with httpcore.ConnectionPool(
network_backend=network_backend,
) as pool:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
response = pool.request("GET", "https://example.com/")
assert response.status == 200
assert response.content == b"Hello, world!"
Expand Down Expand Up @@ -471,7 +471,7 @@ def test_connection_pool_with_immediate_expiry():
keepalive_expiry=0.0,
network_backend=network_backend,
) as pool:
# Sending an intial request, which once complete will not return to the pool.
# Sending an initial request, which once complete will not return to the pool.
with pool.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in pool.connections]
assert info == [
Expand Down Expand Up @@ -504,7 +504,7 @@ def test_connection_pool_with_no_keepalive_connections_allowed():
with httpcore.ConnectionPool(
max_keepalive_connections=0, network_backend=network_backend
) as pool:
# Sending an intial request, which once complete will not return to the pool.
# Sending an initial request, which once complete will not return to the pool.
with pool.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in pool.connections]
assert info == [
Expand Down
6 changes: 3 additions & 3 deletions tests/_sync/test_http_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def test_proxy_forwarding():
max_connections=10,
network_backend=network_backend,
) as proxy:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
with proxy.stream("GET", "http://example.com/") as response:
info = [repr(c) for c in proxy.connections]
assert info == [
Expand Down Expand Up @@ -92,7 +92,7 @@ def test_proxy_tunneling():
proxy=Proxy("http://localhost:8080/"),
network_backend=network_backend,
) as proxy:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
with proxy.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in proxy.connections]
assert info == [
Expand Down Expand Up @@ -184,7 +184,7 @@ def test_proxy_tunneling_http2():
network_backend=network_backend,
http2=True,
) as proxy:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
with proxy.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in proxy.connections]
assert info == [
Expand Down
6 changes: 3 additions & 3 deletions tests/_sync/test_socks_proxy.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def test_socks5_request():
proxy=httpcore.Proxy("socks5://localhost:8080/"),
network_backend=network_backend,
) as proxy:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
with proxy.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in proxy.connections]
assert info == [
Expand Down Expand Up @@ -91,7 +91,7 @@ def test_authenticated_socks5_request():
),
network_backend=network_backend,
) as proxy:
# Sending an intial request, which once complete will return to the pool, IDLE.
# Sending an initial request, which once complete will return to the pool, IDLE.
with proxy.stream("GET", "https://example.com/") as response:
info = [repr(c) for c in proxy.connections]
assert info == [
Expand Down Expand Up @@ -171,7 +171,7 @@ def test_socks5_request_failed_to_provide_auth():
def test_socks5_request_incorrect_auth():
"""
Attempt to send an HTTP request via an authenticated SOCKS proxy,
wit incorrect authentication credentials.
with incorrect authentication credentials.
"""
network_backend = httpcore.MockBackend(
[
Expand Down
Loading