You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* MIME Checking
• Adds the ability for the SDK to use attachments with no file extension
• Also adds the ability to specify the file type using the URL query parameter "file_type"
• If a media attachment URL does not contain a file extension, the SDK will now download the file and check the MIME type of the request to make sure it is a valid file type.
* Change Extension Priorities
• Changes the file extension extraction priorities to be: 1. extract extension from URL itself 2. extract extension from MIME type. 3. extract extension from URL query parameter called 'filename' if provided
• Adds tests to ensure the media URL's are being parsed correctly, and tests the priority of file extension parsing
* Streamline Tests
• Streamlines some code that shouldn't be duplicated
* Cleanup
• Removes URL parsing code that is no longer needed because we've changed the way URL's get parsed
let mimeType = [NSURLSessiondownloadItemAtURL:url toFile:filePath error:error];
758
+
759
+
if (error) {
760
+
[OneSignal onesignal_Log:ONE_S_LL_ERROR message:[NSStringstringWithFormat:@"Encountered an error while attempting to download file with URL: %@", error]];
761
+
returnnil;
762
+
}
763
+
764
+
if (!extension) {
765
+
NSString *newExtension;
766
+
767
+
if (mimeType != nil && ![mimeType isEqualToString:@""]) {
[OneSignal onesignal_Log:ONE_S_LL_ERROR message:[NSStringstringWithFormat:@"Encountered an error while attempting to download file with URL: %@", error]];
0 commit comments