chiark / gitweb /
journal-remote: let user specify just the main part of the url
[elogind.git] / src / journal-remote / journal-upload.c
index 95be9a0e21f451f84a2fadfa33c2793908775118..c5a3e1907bc4502addf5682f098276b447ba0bb0 100644 (file)
@@ -396,7 +396,13 @@ static int setup_uploader(Uploader *u, const char *url, const char *state_file)
         memzero(u, sizeof(Uploader));
         u->input = -1;
 
-        u->url = url;
+        if (!startswith(url, "http://") && !startswith(url, "https://"))
+                url = strappenda("https://", url);
+
+        u->url = strappend(url, "/upload");
+        if (!u->url)
+                return log_oom();
+
         u->state_file = state_file;
 
         r = sd_event_default(&u->events);
@@ -424,6 +430,8 @@ static void destroy_uploader(Uploader *u) {
         free(u->last_cursor);
         free(u->current_cursor);
 
+        free(u->url);
+
         u->input_event = sd_event_source_unref(u->input_event);
 
         close_fd_input(u);