From c174833734968e52412ef2283a22ee672e55e60f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tam=C3=A1s=20B=C3=A1lint=20Misius?= Date: Thu, 20 Jun 2024 12:13:39 +0200 Subject: [PATCH] Complain about http:// URL bases when enforce_https=true --- src/meson.build | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/meson.build b/src/meson.build index 133dd2a6e..0a7078ead 100644 --- a/src/meson.build +++ b/src/meson.build @@ -24,6 +24,7 @@ conf_data.set('ALLOW_FAKE_NEWER_VERSION', (is_snapshot or is_beta or is_debug or conf_data.set('IDENT_PLATFORM', ident_platform) conf_data.set('IDENT', '@0@-@1@-@2@'.format(host_arch, host_platform, host_libc).to_upper()) +enforce_https = get_option('enforce_https') server = get_option('server') static_server = get_option('static_server') update_server = get_option('update_server') @@ -31,9 +32,15 @@ update_server = get_option('update_server') if not (server.startswith('http://') or server.startswith('https://')) server = 'https://' + server endif +if server.startswith('http://') and enforce_https + error('enforce_https is true but server is a http:// URL base') +endif if not (static_server.startswith('http://') or static_server.startswith('https://')) static_server = 'https://' + static_server endif +if static_server.startswith('http://') and enforce_https + error('enforce_https is true but static_server is a http:// URL base') +endif use_update_server = false if update_server != '' @@ -41,12 +48,14 @@ if update_server != '' if not (update_server.startswith('http://') or update_server.startswith('https://')) update_server = 'https://' + update_server endif + if update_server.startswith('http://') and enforce_https + error('enforce_https is true but update_server is a http:// URL base') + endif endif conf_data.set('USE_UPDATESERVER', use_update_server.to_string()) conf_data.set('UPDATESERVER', update_server) platform_clipboard = get_option('platform_clipboard') -enforce_https = get_option('enforce_https') allow_quit = true force_window_frame_ops = 'forceWindowFrameOpsNone' allow_data_folder = true