mirror of
https://github.com/OpenAPITools/openapi-generator.git
synced 2025-12-11 08:22:45 +00:00
[swift] [urlsession] Fixes crash for uploads with content-type "image/" (#21544)
* Fix image upload for content-type image
* update samples
* add test case in spec and update samples
* update bitrise stack so we get xcpretty 0.4.1
* Revert "add test case in spec and update samples"
This reverts commit 92202dd850.
This commit is contained in:
@@ -140,7 +140,7 @@ open class URLSessionRequestBuilder<T>: RequestBuilder<T>, @unchecked Sendable {
|
||||
encoding = FormDataEncoding(contentTypeForFormPart: contentTypeForFormPart(fileURL:))
|
||||
} else if contentType.hasPrefix("application/x-www-form-urlencoded") {
|
||||
encoding = FormURLEncoding()
|
||||
} else if contentType.hasPrefix("application/octet-stream"){
|
||||
} else if contentType.hasPrefix("application/octet-stream") || contentType.hasPrefix("image/") {
|
||||
encoding = OctetStreamEncoding()
|
||||
} else {
|
||||
fatalError("Unsupported Media Type - \(contentType)")
|
||||
|
||||
Reference in New Issue
Block a user