[gvfs] dav: do not set "application/octet-stream" mime type



commit bccf6a229448ed944963095b673adc5f13649b12
Author: Ondrej Holy <oholy redhat com>
Date:   Thu Jan 15 15:56:46 2015 +0100

    dav: do not set "application/octet-stream" mime type
    
    Mime type octet-stream is set when writing since commit 635c3b5,
    because soup_message_set_request requires to be called with mime type
    and we don't know it. Unfortunatelly some servers returns this mime
    type for written files instead of real mime type. Use
    soup_message_body_append instead without mimetype to fix this issue.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=687757

 daemon/gvfsbackenddav.c |    6 +-----
 1 files changed, 1 insertions(+), 5 deletions(-)
---
diff --git a/daemon/gvfsbackenddav.c b/daemon/gvfsbackenddav.c
index 88ea6e3..2d2704a 100644
--- a/daemon/gvfsbackenddav.c
+++ b/daemon/gvfsbackenddav.c
@@ -2564,8 +2564,7 @@ try_close_write (GVfsBackend *backend,
   data = g_memory_output_stream_steal_data (G_MEMORY_OUTPUT_STREAM (stream));
   g_object_unref (stream);
 
-  soup_message_set_request (msg, "application/octet-stream",
-                           SOUP_MEMORY_TAKE, data, length);
+  soup_message_body_append (msg->request_body, SOUP_MEMORY_TAKE, data, length);
   soup_session_queue_message (G_VFS_BACKEND_HTTP (backend)->session,
                              msg, try_close_write_sent, job);
 
@@ -3111,9 +3110,6 @@ push_setup_message (PushHandle *handle)
                                      SOUP_ENCODING_CONTENT_LENGTH);
   soup_message_headers_set_content_length (handle->msg->request_headers,
                                            handle->size);
-  soup_message_headers_set_content_type (handle->msg->request_headers,
-                                         "application/octet-stream",
-                                         NULL);
 }
 
 static void


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]