@capacitor/ios 6.2.0 → 6.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.
|
@@ -58,8 +58,7 @@ open class WebViewAssetHandler: NSObject, WKURLSchemeHandler {
|
|
|
58
58
|
}
|
|
59
59
|
|
|
60
60
|
if let rangeString = urlSchemeTask.request.value(forHTTPHeaderField: "Range"),
|
|
61
|
-
let totalSize = try fileUrl.resourceValues(forKeys: [.fileSizeKey]).fileSize
|
|
62
|
-
isMediaExtension(pathExtension: url.pathExtension) {
|
|
61
|
+
let totalSize = try fileUrl.resourceValues(forKeys: [.fileSizeKey]).fileSize {
|
|
63
62
|
let fileHandle = try FileHandle(forReadingFrom: fileUrl)
|
|
64
63
|
let parts = rangeString.components(separatedBy: "=")
|
|
65
64
|
let streamParts = parts[1].components(separatedBy: "-")
|
|
@@ -497,6 +497,15 @@ var nativeBridge = (function (exports) {
|
|
|
497
497
|
if (doPatchHttp) {
|
|
498
498
|
// fetch patch
|
|
499
499
|
window.fetch = async (resource, options) => {
|
|
500
|
+
const headers = new Headers(options === null || options === void 0 ? void 0 : options.headers);
|
|
501
|
+
const contentType = headers.get('Content-Type') || headers.get('content-type');
|
|
502
|
+
if ((options === null || options === void 0 ? void 0 : options.body) instanceof FormData &&
|
|
503
|
+
(contentType === null || contentType === void 0 ? void 0 : contentType.includes('multipart/form-data')) &&
|
|
504
|
+
!contentType.includes('boundary')) {
|
|
505
|
+
headers.delete('Content-Type');
|
|
506
|
+
headers.delete('content-type');
|
|
507
|
+
options.headers = headers;
|
|
508
|
+
}
|
|
500
509
|
const request = new Request(resource, options);
|
|
501
510
|
if (request.url.startsWith(`${cap.getServerUrl()}/`)) {
|
|
502
511
|
return win.CapacitorWebFetch(resource, options);
|
package/package.json
CHANGED