Skip to content

Keep full server name with path #19

@AlexeiMezin

Description

@AlexeiMezin

My gotify server has URL like http://server.tld/serverpath.

Gotify-tray fails to connect because qUrl splits server URL into host (server.tld) and path (serverpath). and path part is overwritten with gotify request.

So it is better to keep full server address

--- ./gotifyapi.cpp.orig        2026-02-17 19:51:35.000000000 +0300
+++ ./gotifyapi.cpp     2026-05-10 14:12:15.407441442 +0300
@@ -23,7 +23,9 @@
 QNetworkReply * GotifyApi::get(QString endpoint, QUrlQuery query)
 {
     QUrl url(serverUrl);
-    url.setPath(endpoint);
+    // keep FULL server address!
+    QString tmpstr = url.path();
+    url.setPath(tmpstr + "/" + endpoint);
     url.setQuery(query);
     request.setUrl(url);
 
@@ -39,7 +41,9 @@
 GotifyApi::deleteResource(QString endpoint)
 {
     QUrl url(serverUrl);
-    url.setPath(endpoint);
+    // keep FULL server address!
+    QString tmpstr = url.path();
+    url.setPath(tmpstr + "/" + endpoint);
     request.setUrl(url);
     QNetworkReply* reply = QNetworkAccessManager::deleteResource(request);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions