@capacitor/ios 5.2.0 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -144,7 +144,7 @@ open class CapacitorUrlRequest: NSObject, URLSessionTaskDelegate {
144
144
  return data
145
145
  }
146
146
 
147
- public func getRequestData(_ body: JSValue, _ contentType: String, _ dataType: String) throws -> Data? {
147
+ public func getRequestData(_ body: JSValue, _ contentType: String, _ dataType: String? = nil) throws -> Data? {
148
148
  if dataType == "file" {
149
149
  guard let stringData = body as? String else {
150
150
  throw CapacitorUrlRequestError.serializationError("[ data ] argument could not be parsed as string")
@@ -185,7 +185,7 @@ open class CapacitorUrlRequest: NSObject, URLSessionTaskDelegate {
185
185
  }
186
186
  }
187
187
 
188
- public func setRequestBody(_ body: JSValue, _ dataType: String) throws {
188
+ public func setRequestBody(_ body: JSValue, _ dataType: String? = nil) throws {
189
189
  let contentType = self.getRequestHeader("Content-Type") as? String
190
190
 
191
191
  if contentType != nil {
@@ -43,7 +43,7 @@ internal class WebViewAssetHandler: NSObject, WKURLSchemeHandler {
43
43
  ]
44
44
 
45
45
  // if using live reload, then set CORS headers
46
- if self.serverUrl != nil && self.serverUrl?.scheme != localUrl.scheme {
46
+ if self.serverUrl != nil && self.serverUrl?.scheme != localUrl.scheme {
47
47
  headers["Access-Control-Allow-Origin"] = self.serverUrl?.absoluteString
48
48
  headers["Access-Control-Allow-Methods"] = "GET, OPTIONS"
49
49
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@capacitor/ios",
3
- "version": "5.2.0",
3
+ "version": "5.2.1",
4
4
  "description": "Capacitor: Cross-platform apps with JavaScript and the web",
5
5
  "homepage": "https://capacitorjs.com",
6
6
  "author": "Ionic Team <hi@ionic.io> (https://ionic.io)",