async-http-client
async-http-client copied to clipboard
HTTP client library built on SwiftNIO
Many libraries depend on AHC which is great. The downside is that that means to test these libraries they either need to provide a layer which allows to fake AHC...
[initial suggestion from @Lukasa] AHC should support a "middleware" concept (ideally once it's a ["3-tier library"](https://github.com/swift-server/async-http-client/issues/392)) where a user can supply some middlewares which do common jobs like following redirects,...
Immediate questions: - will `didFinishRequest` be called after `didReceiveError`? Yes/No/Maybe - can `didSendRequestHead` be called if either `didFinishRequest` / `didReceiveError` were previously called? - can `didReceiveBodyPart` be called if either...
The delegate should be able to log through `task.logger` which is even available but `internal` and not `public`.
In a previous PR this test hit a 10 minute timeout. The test should fail instantly, so investigate why this failed.
3 makes it less likely that correlated Channels share an EventLoop so it should shake out more threading bugs...
When we updated to Code of Conduct 1.4, we may have forgotten AHC.
HTTPClient should probably provide all delegates with a `NIOThreadPool`. That way file downloads can be done in a sane way.
Unfortunately, there's a real issue with using SwiftFormat in an automated way: SwiftFormat seems to randomly change its default formatting. That means that to pass the AHC CI you'll need...
I noticed that I was able to replace the same-origin check in HTTPHandler with `if true` and `if false` and still pass all of the tests. https://github.com/swift-server/async-http-client/blob/f3521033efcf02027367197986afbbf6808a1ed8/Sources/AsyncHTTPClient/HTTPHandler.swift#L1241