Files
async-http-client/Sources/AsyncHTTPClient/ConnectionPool/HTTP1.1
Fabian Fett 324adb73ae HTTP1Connection: Close on error while in request (#425)
### Motivation

In the `HTTP1ConnectionStateMachine` we set the connection state to `.closed` after having forwarded an error to the inner RequestStateMachine. Since we set the state to close, the `state.modify` function did not create an action that would close the connection.

### Changes

- Modify the ConnectionState based on the RequestStateMachine's action only in the `state.modify` function.
- Add a test to verify the fixed behavior.
- Use ExpressibleByDictionaryLiteral syntax for some HTTPHeaders to increase readability.

### Result

Connections are closed, if an error happens, while we are in a request.
2021-09-14 10:27:32 +02:00
..