Skip to content

Commit

Permalink
Make HTTPHeaders Sendable (#3856)
Browse files Browse the repository at this point in the history
### Goals ⚽
Similar to `HTTPMethod` in #3848, `HTTPHeaders` is trivially `Sendable`,
so add the conformance (and others).

### Implementation Details 🚧
Explicitly declared conformances.

### Testing Details 🔍
No additional tests, conformances are synthesized.
  • Loading branch information
jshier committed Mar 31, 2024
1 parent 9e9943f commit c8fb558
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ jobs:
- name: Install Firewalk
run: brew install alamofire/alamofire/firewalk || brew upgrade alamofire/alamofire/firewalk xcbeautify && firewalk &
- name: Test SPM
run: swift test -c debug | ${{ matrix.outputFilter }}
run: swift test -c debug 2>&1 | ${{ matrix.outputFilter }}
Linux:
name: Linux
runs-on: ubuntu-latest
Expand All @@ -283,6 +283,11 @@ jobs:
- image: swift:5.9-centos7
- image: swift:5.9-amazonlinux2
- image: swift:5.9-rhel-ubi9
- image: swift:5.10-focal
- image: swift:5.10-jammy
- image: swift:5.10-centos7
- image: swift:5.10-amazonlinux2
- image: swift:5.10-rhel-ubi9
- image: swiftlang/swift:nightly-focal
- image: swiftlang/swift:nightly-jammy
- image: swiftlang/swift:nightly-amazonlinux2
Expand Down Expand Up @@ -315,6 +320,9 @@ jobs:
- branch: swift-5.9-release
tag: 5.9-RELEASE
name: Windows Swift 5.9
- branch: swift-5.10-release
tag: 5.10-RELEASE
name: Windows Swift 5.10
steps:
- name: Setup
uses: compnerd/gha-setup-swift@main
Expand Down
4 changes: 2 additions & 2 deletions Source/Core/HTTPHeaders.swift
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
import Foundation

/// An order-preserving and case-insensitive representation of HTTP headers.
public struct HTTPHeaders {
public struct HTTPHeaders: Equatable, Hashable, Sendable {
private var headers: [HTTPHeader] = []

/// Creates an empty instance.
Expand Down Expand Up @@ -185,7 +185,7 @@ extension HTTPHeaders: CustomStringConvertible {
// MARK: - HTTPHeader

/// A representation of a single HTTP header's name / value pair.
public struct HTTPHeader: Hashable {
public struct HTTPHeader: Equatable, Hashable, Sendable {
/// Name of the header.
public let name: String

Expand Down

0 comments on commit c8fb558

Please sign in to comment.