Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
146 commits
Select commit Hold shift + click to select a range
b1e4f19
Use SPM API diff checker (#572)
FranzBusch Mar 28, 2022
f50bf98
Tolerate the request stream being started after .finished (#577)
Lukasa Apr 11, 2022
d2da15c
[HTTP2] Tolerate GoAway and Settings frames after connection close (#…
fabianfett Apr 11, 2022
0a2004b
[HTTP1] Tolerate immediate write errors (#579)
fabianfett Apr 11, 2022
9d8cd95
[Redirect] Allow redirect response to have body (#580)
fabianfett Apr 12, 2022
13e93d4
Drop support for Swift 5.2 and 5.3 (#581)
fabianfett Apr 21, 2022
89b0da2
Add HTTPClientError shortDescription property (#583)
cpriebe Apr 22, 2022
3725095
Fix flaky `HTTPClientTests.testResponseDelayGet()` test (#584)
dnadoba Apr 22, 2022
a586fba
Fix flaky `TransactionTests.testResponseStreamFails()` test (#582)
dnadoba Apr 22, 2022
2442598
Call `didSendRequestPart` after the write has hit the socket (#566)
FranzBusch Apr 26, 2022
3fcd670
Improve errors and testing using NIOTS (#588)
Lukasa Jun 1, 2022
2483e08
Fix crash when receiving 2xx response before stream is complete. (#591)
Lukasa Jun 7, 2022
0f21b44
Use a local TCP server that doesn’t accept connections on macOS for `…
dnadoba Jun 9, 2022
062989e
Correctly reset our state after .sendEnd (#597)
Lukasa Jun 17, 2022
ac34f6d
Correctly handle Connection: close with streaming (#598)
Lukasa Jun 17, 2022
9a8553e
Correctly close the connection if sendEnd fails (#599)
Lukasa Jun 17, 2022
794dc9d
Add `testSelfSignedCertificateIsRejectedWithCorrectError` (#594)
dnadoba Jun 17, 2022
b3583ba
Fix flaky Network.framework `testConnectionFailError` test (#600)
dnadoba Jun 24, 2022
14fa6d9
Report last connection error if request deadline is exceeded (#601)
dnadoba Jul 1, 2022
1af18d2
Use 5.7 nightlies (#593)
Lukasa Jul 4, 2022
2adca4b
Use `swift-atomics` instead of `NIOAtomics` (#603)
dnadoba Jul 13, 2022
0527bbb
Remove the last remaining NIOAtomic (#607)
Lukasa Aug 3, 2022
3960678
Don’t call `didReceiveError` twice if deadline is exceeded and reques…
dnadoba Aug 4, 2022
a9c3cfb
Report last connection error if request deadline is exceeded with asy…
dnadoba Aug 4, 2022
46d1c76
Support transparent decompression with HTTP/2 (#610)
dnadoba Aug 5, 2022
df87a86
Limit max recursion depth delivering body parts (#611)
Lukasa Aug 5, 2022
5e3e58d
Use Docc for documentation (#613)
Lukasa Aug 9, 2022
f90cda4
Validate missing imports in CI (#615)
Lukasa Aug 16, 2022
e294c8f
Accurately apply the connect timeout in async code (#616)
Lukasa Aug 16, 2022
0469acb
Tollerate more data after request body is cancelled (#617)
dnadoba Aug 18, 2022
fc510a3
Fix thread leak in `FileDownloadDelegate` (#614)
dnadoba Aug 18, 2022
18109d8
Use NIOCore.System.coreCount for the fileIO thread pool (#618)
karwa Aug 20, 2022
d764c1a
NIOFoundationCompat does not appear to be used (#619)
karwa Aug 20, 2022
9c7ab03
Allow `HTTPClientRequest` to be executed multiple times if `body` is …
dnadoba Aug 23, 2022
c3c90aa
Adopt `Sendable` (#621)
dnadoba Aug 25, 2022
8994e1f
not that simple anymore ;) (#624)
weissi Sep 5, 2022
7f998f5
add a future-returning shutdown method (#626)
weissi Sep 7, 2022
897d49a
Replace Lock with NIOLock (#628)
fabianfett Sep 27, 2022
03b3e7b
Update files missed by #628 (#629)
Lukasa Sep 27, 2022
b57bcb9
Raise minimum supported Swift version from 5.4 to 5.5 (#630)
glbrntt Sep 28, 2022
64ff430
Add Hashable conformace to `HTTPClient.Configuration.Proxy` (#634)
fabianfett Oct 7, 2022
af5966f
Reduce use of `HTTPClient.Configuration` in the Connection objects (#…
fabianfett Oct 7, 2022
4d69c84
Add `Hashable` conformance to `HTTPClient.Configuration.HTTPVersion` …
fabianfett Oct 7, 2022
f7a84af
Fix request hang if delegate fails promise returned by `didReceiveBod…
dnadoba Oct 7, 2022
9937d87
Handle ResponseAccumulator not being able to buffer large response in…
dnadoba Oct 10, 2022
f17a47e
Allow immediate request failure on connection error (#625)
dnadoba Oct 10, 2022
d7b69d9
Make `HTTPClientResponse.init` public (#632)
dnadoba Oct 11, 2022
9195d3b
Speedup tests (#639)
dnadoba Oct 11, 2022
0b5bec7
Replace `NIOSendable` with `Sendable` (#640)
dnadoba Oct 12, 2022
0bdc425
Remove `#if compiler(>=5.5)` (#641)
dnadoba Oct 12, 2022
10f42e6
FileDownloadDelegate: mark `Progress` as `Sendable` (#643)
MaxDesiatov Oct 26, 2022
8b84142
Use #fileID/#filePath instead of #file (#644)
carolinacass Nov 4, 2022
708ead8
Remove obsolete notes in README.md (#645)
dnadoba Nov 8, 2022
fd03ed0
Tolerate shutdown message after channel is closed (#646)
dnadoba Nov 8, 2022
5bee16a
Switch over state in `HTTPConnectionPool.HTTP2StateMachine.failedToCr…
dnadoba Nov 9, 2022
2859c10
Add .spi.yml for Swift Package Index DocC support (#648)
yim-lee Dec 2, 2022
49abfc3
Add `Host` header (#650) (#651)
MihaelIsaev Dec 6, 2022
7f05a8d
Merge pull request from GHSA-v3r5-pjpm-mwgq
Lukasa Jan 17, 2023
5daaa38
Add Swift 5.8 CI and update nightly CI to Ubuntu 22.04 (#655)
dnadoba Jan 18, 2023
817d9aa
Make Task.logger accessible to delegate implementations outside of Pa…
felixschlegel Jan 22, 2023
67f99d1
Add test for HTTP1 request with large header (#658)
dnadoba Jan 26, 2023
59bfb96
Add test for HTTP2 request with large header (#659)
dnadoba Jan 26, 2023
f65f45b
Fix Request streaming memory leak (#665)
fabianfett Feb 7, 2023
aa66da8
Fix request head continuation misuse (#666)
dnadoba Feb 10, 2023
1d24271
Fix crash for large HTTP request headers (#661)
dnadoba Feb 10, 2023
9401037
Make syncShutdown unavailable from async (#667)
Lukasa Feb 13, 2023
e264599
Fix HTTP2StreamChannel leak (#657)
fabianfett Feb 14, 2023
864c8d9
Mark Task.wait() noasync and provide Task.get() (#668)
Lukasa Feb 14, 2023
423fd0b
Fix crash if connection is closed very early (#671)
dnadoba Mar 14, 2023
98b45ed
Allow DNS override (#675)
dnadoba Mar 30, 2023
9cdc429
Accept bare 2023 in license header (#676)
Lukasa Apr 3, 2023
91b2640
Update collect to use content-length to make early checks
carolinacass Apr 4, 2023
343cdf4
Fix documentation and add support for CI-ing it (#679)
Lukasa Apr 11, 2023
6c5058e
Add a control to limit connection reuses (#678)
glbrntt Apr 11, 2023
e18db27
Replace `TransactionBody` with `NIOAsyncSequenceProducer` (#677)
dnadoba Apr 12, 2023
5b4f03d
Add docker-compose file for Swift 5.9 (#682)
yim-lee Apr 13, 2023
45626d3
Pass request `Task` to `FileDownloadDelegate` `reportHead` and `repor…
dnadoba Apr 13, 2023
b9029ef
Add support for custom cancellation error (#683)
dnadoba Apr 13, 2023
333e60c
Fix building transaction extension for Apple Platforms (#685)
cbaker6 Apr 14, 2023
d62c475
Drop Swift 5.5 (#686)
dnadoba Apr 14, 2023
78db67e
Tolerate new request after connection error happened (#688)
dnadoba May 17, 2023
960af0d
Adopt the Swift CoC (#691)
Lukasa Jun 6, 2023
c7fb775
Replace os() with canImport(Darwin) (#693)
o-nnerb Jun 26, 2023
668c193
Removed duplicated code (#694)
o-nnerb Jun 26, 2023
df66c67
Fixed typo (#695)
o-nnerb Jun 30, 2023
7935de1
Fix flaky `AsyncAwaitEndToEndTests.testImmediateDeadline` test (#698)
dnadoba Jul 14, 2023
e1c85a6
Add timeout to `RequestBagTests.testCancelFailsTaskAfterRequestIsSent…
dnadoba Jul 14, 2023
62c06d4
Remove tests relying on OS-dependent behaviour (#703)
Lukasa Aug 10, 2023
8c90405
use NIOSingletons EventLoops/NIOThreadPool instead of spawning new (#…
weissi Aug 14, 2023
16f7e62
Add unit tests for NWWaitingHandler, closes #589 (#702)
natikgadzhi Aug 14, 2023
75d7f63
Automatically chunk large request bodies (#710)
dnadoba Sep 6, 2023
4e74fef
Support custom `backgroundActivityLogger` with using the default ELG.…
dnadoba Sep 6, 2023
de7c84a
Bump minimum Swift version to 5.7 (#712)
rnro Oct 4, 2023
4c07d3b
Fix flaky test `TransactionTests.testCancelAsyncRequest` (#707)
dnadoba Oct 4, 2023
d766674
HTTPClientRequest: allow custom TLS config (#709)
weissi Oct 16, 2023
4824907
Fix wrong/outdated `connect` timeout documentation (#714)
MahdiBM Oct 25, 2023
c70e085
testPlatformConnectErrorIsForwardedOnTimeout port reuse (#716)
PeterAdams-A Nov 3, 2023
d2d3566
Add an idle write timeout (#718)
gjcairo Dec 18, 2023
a4904fc
Add missing availability guards in tests (#719)
simonjbeaumont Dec 18, 2023
ffe36fc
Fix potential race conditions when cancelling read/write idle timers …
gjcairo Dec 18, 2023
75fce63
Update Package.swift (#722)
nishant-dani Dec 20, 2023
5ccda44
Use the given connection pool idle timeout in the HTTPClient.Configur…
gjcairo Dec 21, 2023
2914386
Update minimum swift-nio version (#725)
gjcairo Jan 12, 2024
09b7eb7
Add support for Musl. (#726)
al45tair Jan 20, 2024
e6a630d
Raise minimum Swift version to 5.8 (#729)
glbrntt Mar 11, 2024
83f015b
Fix write timeout not being initialised (#730)
gjcairo Mar 21, 2024
36292f9
Renew certificates in tests (#731)
hamzahrmalik Mar 29, 2024
e0977cf
HTTPClient.shared a globally shared singleton & .browserLike configur…
weissi Apr 3, 2024
fb308ee
Move availability guard to correct test (#734)
hamzahrmalik Apr 5, 2024
a220837
Disable SETTINGS_ENABLE_PUSH HTTP/2 setting (#741)
gjcairo May 1, 2024
2fa5b34
Update Examples to use `.singleton` (#742)
chieffancypants May 9, 2024
0ae99db
Increase decompression limit ratio 10 -> 25 (#740)
MahdiBM May 9, 2024
e27aef4
Make ConnectionPool's `retryConnectionEstablishment` public (#744)
andreasley Jun 18, 2024
4316eca
Add support for request body to be larger than 2GB on 32-bit devices …
aryan-25 Jun 28, 2024
07536f6
Resolve ambiguity issue for the `stream` function, remove @deprecated…
aryan-25 Jul 3, 2024
54d1006
Add leading slash in relative URL requests if necessary (#747)
aryan-25 Jul 9, 2024
07f171b
Avoid using deprecated API in tests (#762)
Lukasa Aug 7, 2024
0bd9111
mark HTTPClient.Response Sendable (#759)
weissi Aug 7, 2024
4b7a68e
Fix OOM issue when setting `concurrentHTTP1ConnectionsPerHostSoftLimi…
aryan-25 Aug 14, 2024
1290119
Assume http2 connection by default, instead of http1 (#758)
ayush1794 Aug 15, 2024
e8babad
Add releases.yml config for github (#765)
PeterAdams-A Aug 16, 2024
776a1c2
Fix NIO deprecations after update to `2.71.0` (#769)
fabianfett Sep 3, 2024
1120541
Fix crash when writablity becomes false and races against finishing t…
fabianfett Sep 3, 2024
6df8e1c
Explicitly import locale modules (#771)
ian-twilightcoder Sep 14, 2024
10bd49c
add .git extensions to dependency URLs (#770)
daSkier Sep 19, 2024
15dbe6d
Add an option to enable Multipath TCP on clients (#766)
Aperence Sep 20, 2024
38608db
Reduce time spent logging EventLoop description in HTTP1ClientChannel…
aryan-25 Sep 23, 2024
64abc77
Don't just import `locale_h`. (#775)
al45tair Sep 30, 2024
0a9b723
workaround Foundation.URL behavior changes (#777)
rnro Oct 3, 2024
acaca2d
Added: ability to set basic authentication on requests (#778)
agamdua Oct 21, 2024
c621142
Adopt GitHub actions (#780)
rnro Oct 29, 2024
5ee3708
remove contributors script (#782)
rnro Nov 14, 2024
c1c5f4b
add .editorconfig file (#781)
rnro Nov 15, 2024
bdaa3b1
remove unused Swift 6 language mode workflow (#783)
rnro Nov 15, 2024
2119f0d
fix 784: dont crash on huge in-memory bodies (#785)
weissi Nov 26, 2024
f3a18d0
Aligning semantic version label check name (#788)
FranzBusch Nov 28, 2024
dbd5c86
Enable MemberImportVisibility check on all targets (#794)
rnro Dec 13, 2024
f77cc00
Update release.yml (#795)
FranzBusch Dec 18, 2024
1265185
Unbreak CI (#800)
Lukasa Jan 14, 2025
e69318d
Android support (#799)
marcprux Jan 14, 2025
f38c2fe
Avoid precondition failure in write timeout (#803)
rnro Jan 28, 2025
60fa3dc
Add missing import of Network module (#804)
tshortli Jan 29, 2025
81384de
CI use 6.1 nightlies (#805)
rnro Jan 30, 2025
89dc8d0
baby steps towards a Structured Concurrency API (#806)
weissi Feb 6, 2025
b645ad4
fix 5.10 compile on Ubuntu 24.04 (Noble) for Intel (x86_64) (#810)
weissi Feb 11, 2025
3b4942f
Remove misuse of EmbeddedEventLoop (#812)
Lukasa Feb 17, 2025
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
8 changes: 8 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
root = true

[*]
indent_style = space
indent_size = 4
end_of_line = lf
insert_final_newline = true
trim_trailing_whitespace = true
14 changes: 14 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
changelog:
categories:
- title: SemVer Major
labels:
- ⚠️ semver/major
- title: SemVer Minor
labels:
- 🆕 semver/minor
- title: SemVer Patch
labels:
- 🔨 semver/patch
- title: Other Changes
labels:
- semver/none
18 changes: 18 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: Main

on:
push:
branches: [main]
schedule:
- cron: "0 8,20 * * *"

jobs:
unit-tests:
name: Unit tests
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
25 changes: 25 additions & 0 deletions .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: PR

on:
pull_request:
types: [opened, reopened, synchronize]

jobs:
soundness:
name: Soundness
uses: swiftlang/github-workflows/.github/workflows/soundness.yml@main
with:
license_header_check_project_name: "AsyncHTTPClient"
unit-tests:
name: Unit tests
uses: apple/swift-nio/.github/workflows/unit_tests.yml@main
with:
linux_5_9_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_5_10_arguments_override: "-Xswiftc -warnings-as-errors --explicit-target-dependency-import-check error"
linux_6_0_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_6_1_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"
linux_nightly_main_arguments_override: "--explicit-target-dependency-import-check error -Xswiftc -require-explicit-sendable"

cxx-interop:
name: Cxx interop
uses: apple/swift-nio/.github/workflows/cxx_interop.yml@main
18 changes: 18 additions & 0 deletions .github/workflows/pull_request_label.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: PR label

on:
pull_request:
types: [labeled, unlabeled, opened, reopened, synchronize]

jobs:
semver-label-check:
name: Semantic version label check
runs-on: ubuntu-latest
timeout-minutes: 1
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
persist-credentials: false
- name: Check for Semantic Version label
uses: apple/swift-nio/.github/actions/pull_request_semver_label_checker@main
37 changes: 37 additions & 0 deletions .licenseignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
.gitignore
**/.gitignore
.licenseignore
.gitattributes
.git-blame-ignore-revs
.mailfilter
.mailmap
.spi.yml
.swift-format
.editorconfig
.github/*
*.md
*.txt
*.yml
*.yaml
*.json
Package.swift
**/Package.swift
Package@-*.swift
**/Package@-*.swift
Package.resolved
**/Package.resolved
Makefile
*.modulemap
**/*.modulemap
**/*.docc/*
*.xcprivacy
**/*.xcprivacy
*.symlink
**/*.symlink
Dockerfile
**/Dockerfile
.dockerignore
Snippets/*
dev/git.commit.template
.unacceptablelanguageignore
Tests/AsyncHTTPClientTests/Resources/*.pem
4 changes: 4 additions & 0 deletions .spi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
version: 1
builder:
configs:
- documentation_targets: [AsyncHTTPClient]
68 changes: 68 additions & 0 deletions .swift-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
{
"version" : 1,
"indentation" : {
"spaces" : 4
},
"tabWidth" : 4,
"fileScopedDeclarationPrivacy" : {
"accessLevel" : "private"
},
"spacesAroundRangeFormationOperators" : false,
"indentConditionalCompilationBlocks" : false,
"indentSwitchCaseLabels" : false,
"lineBreakAroundMultilineExpressionChainComponents" : false,
"lineBreakBeforeControlFlowKeywords" : false,
"lineBreakBeforeEachArgument" : true,
"lineBreakBeforeEachGenericRequirement" : true,
"lineLength" : 120,
"maximumBlankLines" : 1,
"respectsExistingLineBreaks" : true,
"prioritizeKeepingFunctionOutputTogether" : true,
"noAssignmentInExpressions" : {
"allowedFunctions" : [
"XCTAssertNoThrow",
"XCTAssertThrowsError"
]
},
"rules" : {
"AllPublicDeclarationsHaveDocumentation" : false,
"AlwaysUseLiteralForEmptyCollectionInit" : false,
"AlwaysUseLowerCamelCase" : false,
"AmbiguousTrailingClosureOverload" : true,
"BeginDocumentationCommentWithOneLineSummary" : false,
"DoNotUseSemicolons" : true,
"DontRepeatTypeInStaticProperties" : true,
"FileScopedDeclarationPrivacy" : true,
"FullyIndirectEnum" : true,
"GroupNumericLiterals" : true,
"IdentifiersMustBeASCII" : true,
"NeverForceUnwrap" : false,
"NeverUseForceTry" : false,
"NeverUseImplicitlyUnwrappedOptionals" : false,
"NoAccessLevelOnExtensionDeclaration" : true,
"NoAssignmentInExpressions" : true,
"NoBlockComments" : true,
"NoCasesWithOnlyFallthrough" : true,
"NoEmptyTrailingClosureParentheses" : true,
"NoLabelsInCasePatterns" : true,
"NoLeadingUnderscores" : false,
"NoParensAroundConditions" : true,
"NoVoidReturnOnFunctionSignature" : true,
"OmitExplicitReturns" : true,
"OneCasePerLine" : true,
"OneVariableDeclarationPerLine" : true,
"OnlyOneTrailingClosureArgument" : true,
"OrderedImports" : true,
"ReplaceForEachWithForLoop" : true,
"ReturnVoidInsteadOfEmptyTuple" : true,
"UseEarlyExits" : false,
"UseExplicitNilCheckInConditions" : false,
"UseLetInEveryBoundCaseVariable" : false,
"UseShorthandTypeNames" : true,
"UseSingleLinePropertyGetter" : false,
"UseSynthesizedInitializer" : false,
"UseTripleSlashForDocumentationComments" : true,
"UseWhereClausesInForLoops" : false,
"ValidateDocumentationComments" : false
}
}
23 changes: 0 additions & 23 deletions .swiftformat

This file was deleted.

54 changes: 2 additions & 52 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -1,55 +1,5 @@
# Code of Conduct
To be a truly great community, AsyncHTTPClient needs to welcome developers from all walks of life,
with different backgrounds, and with a wide range of experience. A diverse and friendly
community will have more great ideas, more unique perspectives, and produce more great
code. We will work diligently to make the AsyncHTTPClient community welcoming to everyone.

To give clarity of what is expected of our members, AsyncHTTPClient has adopted the code of conduct
defined by [contributor-covenant.org](https://www.contributor-covenant.org). This document is used across many open source
communities, and we think it articulates our values well. The full text is copied below:
The code of conduct for this project can be found at https://swift.org/code-of-conduct.

### Contributor Code of Conduct v1.3
As contributors and maintainers of this project, and in the interest of fostering an open and
welcoming community, we pledge to respect all people who contribute through reporting
issues, posting feature requests, updating documentation, submitting pull requests or patches,
and other activities.

We are committed to making participation in this project a harassment-free experience for
everyone, regardless of level of experience, gender, gender identity and expression, sexual
orientation, disability, personal appearance, body size, race, ethnicity, age, religion, or
nationality.

Examples of unacceptable behavior by participants include:
- The use of sexualized language or imagery
- Personal attacks
- Trolling or insulting/derogatory comments
- Public or private harassment
- Publishing other’s private information, such as physical or electronic addresses, without explicit permission
- Other unethical or unprofessional conduct

Project maintainers have the right and responsibility to remove, edit, or reject comments,
commits, code, wiki edits, issues, and other contributions that are not aligned to this Code of
Conduct, or to ban temporarily or permanently any contributor for other behaviors that they
deem inappropriate, threatening, offensive, or harmful.

By adopting this Code of Conduct, project maintainers commit themselves to fairly and
consistently applying these principles to every aspect of managing this project. Project
maintainers who do not follow or enforce the Code of Conduct may be permanently removed
from the project team.

This code of conduct applies both within project spaces and in public spaces when an
individual is representing the project or its community.

Instances of abusive, harassing, or otherwise unacceptable behavior may be reported by
contacting a project maintainer at [[email protected]](mailto:[email protected]). All complaints will be reviewed and
investigated and will result in a response that is deemed necessary and appropriate to the
circumstances. Maintainers are obligated to maintain confidentiality with regard to the reporter
of an incident.

*This policy is adapted from the Contributor Code of Conduct [version 1.3.0](https://contributor-covenant.org/version/1/3/0/).*

### Reporting
A working group of community members is committed to promptly addressing any [reported issues](mailto:[email protected]).
Working group members are volunteers appointed by the project lead, with a
preference for individuals with varied backgrounds and perspectives. Membership is expected
to change regularly, and may grow or shrink.
<!-- Copyright (c) 2023 Apple Inc and the Swift Project authors. All Rights Reserved. -->
8 changes: 4 additions & 4 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,18 +57,18 @@ A good AsyncHTTPClient patch is:
3. Documented, adding API documentation as needed to cover new functions and properties.
4. Accompanied by a great commit message, using our commit message template.

*Note* as of version 1.5.0 AsyncHTTPClient requires Swift 5.2. Earlier versions support as far back as Swift 5.0.
*Note* as of version 1.10.0 AsyncHTTPClient requires Swift 5.4. Earlier versions support as far back as Swift 5.0.

### Commit Message Template

We require that your commit messages match our template. The easiest way to do that is to get git to help you by explicitly using the template. To do that, `cd` to the root of our repository and run:

git config commit.template dev/git.commit.template

### Make sure Tests work on Linux

AsyncHTTPClient uses XCTest to run tests on both macOS and Linux. While the macOS version of XCTest is able to use the Objective-C runtime to discover tests at execution time, the Linux version is not.
For this reason, whenever you add new tests **you have to run a script** that generates the hooks needed to run those tests on Linux, or our CI will complain that the tests are not all present on Linux. To do this, merely execute `ruby ./scripts/generate_linux_tests.rb` at the root of the package and check the changes it made.
### Run CI checks locally

You can run the Github Actions workflows locally using [act](https://github.com/nektos/act). For detailed steps on how to do this please see [https://github.com/swiftlang/github-workflows?tab=readme-ov-file#running-workflows-locally](https://github.com/swiftlang/github-workflows?tab=readme-ov-file#running-workflows-locally).

## How to contribute your work

Expand Down
4 changes: 2 additions & 2 deletions Examples/GetHTML/GetHTML.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ import NIOCore
@main
struct GetHTML {
static func main() async throws {
let httpClient = HTTPClient(eventLoopGroupProvider: .createNew)
let httpClient = HTTPClient(eventLoopGroupProvider: .singleton)
do {
let request = HTTPClientRequest(url: "https://apple.com")
let response = try await httpClient.execute(request, timeout: .seconds(30))
print("HTTP head", response)
let body = try await response.body.collect(upTo: 1024 * 1024) // 1 MB
let body = try await response.body.collect(upTo: 1024 * 1024) // 1 MB
print(String(buffer: body))
} catch {
print("request failed:", error)
Expand Down
4 changes: 2 additions & 2 deletions Examples/GetJSON/GetJSON.swift
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ struct Comic: Codable {
@main
struct GetJSON {
static func main() async throws {
let httpClient = HTTPClient(eventLoopGroupProvider: .createNew)
let httpClient = HTTPClient(eventLoopGroupProvider: .singleton)
do {
let request = HTTPClientRequest(url: "https://xkcd.com/info.0.json")
let response = try await httpClient.execute(request, timeout: .seconds(30))
print("HTTP head", response)
let body = try await response.body.collect(upTo: 1024 * 1024) // 1 MB
let body = try await response.body.collect(upTo: 1024 * 1024) // 1 MB
// we use an overload defined in `NIOFoundationCompat` for `decode(_:from:)` to
// efficiently decode from a `ByteBuffer`
let comic = try JSONDecoder().decode(Comic.self, from: body)
Expand Down
9 changes: 6 additions & 3 deletions Examples/Package.swift
Original file line number Diff line number Diff line change
Expand Up @@ -43,22 +43,25 @@ let package = Package(
dependencies: [
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "NIOCore", package: "swift-nio"),
], path: "GetHTML"
],
path: "GetHTML"
),
.executableTarget(
name: "GetJSON",
dependencies: [
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "NIOCore", package: "swift-nio"),
.product(name: "NIOFoundationCompat", package: "swift-nio"),
], path: "GetJSON"
],
path: "GetJSON"
),
.executableTarget(
name: "StreamingByteCounter",
dependencies: [
.product(name: "AsyncHTTPClient", package: "async-http-client"),
.product(name: "NIOCore", package: "swift-nio"),
], path: "StreamingByteCounter"
],
path: "StreamingByteCounter"
),
]
)
2 changes: 1 addition & 1 deletion Examples/StreamingByteCounter/StreamingByteCounter.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ import NIOCore
@main
struct StreamingByteCounter {
static func main() async throws {
let httpClient = HTTPClient(eventLoopGroupProvider: .createNew)
let httpClient = HTTPClient(eventLoopGroupProvider: .singleton)
do {
let request = HTTPClientRequest(url: "https://apple.com")
let response = try await httpClient.execute(request, timeout: .seconds(30))
Expand Down
4 changes: 2 additions & 2 deletions NOTICE.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,13 +50,13 @@ This product contains a derivation of the Tony Stone's 'process_test_files.rb'.
* https://www.apache.org/licenses/LICENSE-2.0
* HOMEPAGE:
* https://github.com/tonystone/build-tools/commit/6c417b7569df24597a48a9aa7b505b636e8f73a1
* https://github.com/tonystone/build-tools/blob/master/source/xctest_tool.rb
* https://github.com/tonystone/build-tools/blob/cf3440f43bde2053430285b4ed0709c865892eb5/source/xctest_tool.rb

---

This product contains a derivation of Fabian Fett's 'Base64.swift'.

* LICENSE (Apache License 2.0):
* https://github.com/fabianfett/swift-base64-kit/blob/master/LICENSE
* https://github.com/swift-extras/swift-extras-base64/blob/b8af49699d59ad065b801715a5009619100245ca/LICENSE
* HOMEPAGE:
* https://github.com/fabianfett/swift-base64-kit
Loading