Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Gatekeeper dialog for binaries downloaded by the browser #2068

Merged
merged 1 commit into from
Jan 18, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions DuckDuckGo/Common/Extensions/URLExtension.swift
Original file line number Diff line number Diff line change
Expand Up @@ -423,11 +423,9 @@ extension URL {
quarantineProperties[kLSQuarantineDataURLKey as String] = sourceURL
quarantineProperties[kLSQuarantineOriginURLKey as String] = referrerURL

if quarantineProperties[kLSQuarantineTypeKey as String] == nil {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mallexxx any idea why we're checking for nil here? I'm testing various download types (on a release build vs this branch), such as ICS calendar invitations and they're all unaffected by this change. I suppose we're fine with removing this if statement but let me know if we're not. Thanks!

Copy link
Collaborator

@mallexxx mallexxx Jan 17, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don‘t remember exactly why the check was there probably it‘s just a precaution not to overwrite a default value

quarantineProperties[kLSQuarantineTypeKey as String] = ["http", "https"].contains(sourceURL?.scheme)
? kLSQuarantineTypeWebDownload
: kLSQuarantineTypeOtherDownload
}
quarantineProperties[kLSQuarantineTypeKey as String] = ["http", "https"].contains(sourceURL?.scheme)
? kLSQuarantineTypeWebDownload
: kLSQuarantineTypeOtherDownload

try (self as NSURL).setResourceValue(quarantineProperties, forKey: .quarantinePropertiesKey)
}
Expand Down
Loading