aboutsummaryrefslogtreecommitdiff
path: root/plugins/http-files/src
diff options
context:
space:
mode:
authoreerielili <lionel@les-miquelots.net>2024-08-25 13:32:38 +0000
committerGitHub <noreply@github.com>2024-08-25 13:32:38 +0000
commit45755727db79a2935376d24e7bde7eadb0f2f7ca (patch)
tree73715da99c9d980079df6f2d561822364655e04d /plugins/http-files/src
parent62cdea3a5e701c04f3a7fd9d6b5f48e28fef1f72 (diff)
parent51252f74c94c17d56aa75534652bdc5d43a504cb (diff)
downloaddino-45755727db79a2935376d24e7bde7eadb0f2f7ca.tar.gz
dino-45755727db79a2935376d24e7bde7eadb0f2f7ca.zip
Merge branch 'master' into add-yourselfadd-yourself
Diffstat (limited to 'plugins/http-files/src')
-rw-r--r--plugins/http-files/src/file_provider.vala10
-rw-r--r--plugins/http-files/src/file_sender.vala3
2 files changed, 13 insertions, 0 deletions
diff --git a/plugins/http-files/src/file_provider.vala b/plugins/http-files/src/file_provider.vala
index 34c3a48a..d62e3561 100644
--- a/plugins/http-files/src/file_provider.vala
+++ b/plugins/http-files/src/file_provider.vala
@@ -120,6 +120,11 @@ public class FileProvider : Dino.FileProvider, Object {
var head_message = new Soup.Message("HEAD", http_receive_data.url);
head_message.request_headers.append("Accept-Encoding", "identity");
+#if SOUP_3_0
+ string transfer_host = Uri.parse(http_receive_data.url, UriFlags.NONE).get_host();
+ head_message.accept_certificate.connect((peer_cert, errors) => { return ConnectionManager.on_invalid_certificate(transfer_host, peer_cert, errors); });
+#endif
+
try {
#if SOUP_3_0
yield session.send_async(head_message, GLib.Priority.LOW, null);
@@ -153,6 +158,11 @@ public class FileProvider : Dino.FileProvider, Object {
var get_message = new Soup.Message("GET", http_receive_data.url);
+#if SOUP_3_0
+ string transfer_host = Uri.parse(http_receive_data.url, UriFlags.NONE).get_host();
+ get_message.accept_certificate.connect((peer_cert, errors) => { return ConnectionManager.on_invalid_certificate(transfer_host, peer_cert, errors); });
+#endif
+
try {
#if SOUP_3_0
InputStream stream = yield session.send_async(get_message, GLib.Priority.LOW, file_transfer.cancellable);
diff --git a/plugins/http-files/src/file_sender.vala b/plugins/http-files/src/file_sender.vala
index 957611d0..a2f4769b 100644
--- a/plugins/http-files/src/file_sender.vala
+++ b/plugins/http-files/src/file_sender.vala
@@ -94,7 +94,10 @@ public class HttpFileSender : FileSender, Object {
if (stream == null) return;
var put_message = new Soup.Message("PUT", file_send_data.url_up);
+
#if SOUP_3_0
+ string transfer_host = Uri.parse(file_send_data.url_up, UriFlags.NONE).get_host();
+ put_message.accept_certificate.connect((peer_cert, errors) => { return ConnectionManager.on_invalid_certificate(transfer_host, peer_cert, errors); });
put_message.set_request_body(file_meta.mime_type, file_transfer.input_stream, (ssize_t) file_meta.size);
#else
put_message.request_headers.set_content_type(file_meta.mime_type, null);