mirror of
https://github.com/tauri-apps/tauri.git
synced 2024-11-29 13:03:09 +03:00
feat(bundler) add exception_domain option by nothingismagick (#439)
This commit is contained in:
parent
c1638e92a6
commit
12ed096bea
@ -214,6 +214,27 @@ fn create_info_plist(
|
||||
copyright
|
||||
)?;
|
||||
}
|
||||
|
||||
if let Some(exception_domain) = settings.exception_domain() {
|
||||
write!(
|
||||
file,
|
||||
" <key>NSAppTransportSecurity</key>\n \
|
||||
<dict>\n \
|
||||
<key>NSExceptionDomains</key>\n \
|
||||
<dict>\n \
|
||||
<key>{}</key>\n \
|
||||
<dict>\n \
|
||||
<key>NSExceptionAllowsInsecureHTTPLoads</key>\n \
|
||||
<true/>\n \
|
||||
<key>NSIncludesSubdomains</key>\n \
|
||||
<true/>\n \
|
||||
</dict>\n \
|
||||
</dict>\n \
|
||||
</dict>",
|
||||
exception_domain
|
||||
)?;
|
||||
}
|
||||
|
||||
write!(file, "</dict>\n</plist>\n")?;
|
||||
file.flush()?;
|
||||
Ok(())
|
||||
|
@ -111,6 +111,7 @@ struct BundleSettings {
|
||||
bin: Option<HashMap<String, BundleSettings>>,
|
||||
example: Option<HashMap<String, BundleSettings>>,
|
||||
external_bin: Option<Vec<String>>,
|
||||
exception_domain: Option<String>,
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, Deserialize)]
|
||||
@ -433,6 +434,10 @@ impl Settings {
|
||||
}
|
||||
}
|
||||
|
||||
pub fn exception_domain(&self) -> Option<&String> {
|
||||
return self.bundle_settings.exception_domain.as_ref()
|
||||
}
|
||||
|
||||
// copy external binaries to a path.
|
||||
pub fn copy_binaries(&self, path: &Path) -> crate::Result<()> {
|
||||
for src in self.external_binaries() {
|
||||
|
Loading…
Reference in New Issue
Block a user