apple / swift-openapi-urlsession

URLSession transport for Swift OpenAPI Generator.
https://swiftpackageindex.com/apple/swift-openapi-urlsession/documentation
Apache License 2.0
159 stars 31 forks source link

Fix request and response translation #51

Closed guoye-zhang closed 4 months ago

guoye-zhang commented 4 months ago

Motivation

Fix the translation between Foundation types and HTTP types.

Modifications

The code is mostly borrowed from swift-http-types:

https://github.com/apple/swift-http-types/tree/main/Sources/HTTPTypesFoundation

Translates the string encoding (URLSession expects ISOLatin1) and handles multi-value fields.

Result

Should address the cookie issue among other issues.

Test Plan

All existing tests still pass.

simonjbeaumont commented 4 months ago

Change looks great, thank you @guoye-zhang!

Do you think we can extend the tests to cover the different delimiter appending logic based?

guoye-zhang commented 4 months ago

I updated the test with multiple values. ; joining is already tested by the cookie header.

czechboy0 commented 4 months ago

@swift-server-bot test this please

simonjbeaumont commented 4 months ago

@swift-server-bot add to allowlist

czechboy0 commented 4 months ago

The failed CI is a transitive infra issue, rekicking.

czechboy0 commented 4 months ago

@swift-server-bot test this please