fix(journal-gatewayd): use relative urls (not starting with '/')
authorMarkus Felten <Markus.Felten@gmx.de>
Tue, 18 Jun 2019 08:11:28 +0000 (10:11 +0200)
committerLennart Poettering <lennart@poettering.net>
Tue, 18 Jun 2019 15:06:12 +0000 (17:06 +0200)
if journal-gatewayd http is not mounted at '/' (proxy request)
the request lose their initial path component

src/journal-remote/browse.html

index e5162d1..9a5ae80 100644 (file)
 
                 function machineLoad() {
                         var request = new XMLHttpRequest();
-                        request.open("GET", "/machine");
+                        request.open("GET", "machine");
                         request.onreadystatechange = machineOnResult;
                         request.setRequestHeader("Accept", "application/json");
                         request.send(null);
                                         range = "";
                         }
 
-                        var url = "/entries";
+                        var url = "entries";
 
                         if (localStorage["filter"] != "" && localStorage["filter"] != null) {
                                 url += "?_SYSTEMD_UNIT=" + escape(localStorage["filter"]);
 
                 function onMessageClick(t) {
                         var request = new XMLHttpRequest();
-                        request.open("GET", "/entries?discrete");
+                        request.open("GET", "entries?discrete");
                         request.onreadystatechange = onResultMessageClick;
                         request.setRequestHeader("Accept", "application/json");
                         request.setRequestHeader("Range", "entries=" + t + ":0:1");
 
                 function onFilterFocus(w) {
                         var request = new XMLHttpRequest();
-                        request.open("GET", "/fields/_SYSTEMD_UNIT");
+                        request.open("GET", "fields/_SYSTEMD_UNIT");
                         request.onreadystatechange = onResultFilterFocus;
                         request.setRequestHeader("Accept", "application/json");
                         request.send(null);