]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
http: handle tvheadend_webroot for logout cookie
authorJaroslav Kysela <perex@perex.cz>
Mon, 27 Mar 2017 15:46:30 +0000 (17:46 +0200)
committerJaroslav Kysela <perex@perex.cz>
Mon, 27 Mar 2017 15:46:30 +0000 (17:46 +0200)
src/http.c

index f2baf62686fd188be86016e52cc50e9aa79a7e38..2736715907b542607a811e8b58d66832f2bb0e36 100644 (file)
@@ -389,9 +389,11 @@ http_send_header(http_connection_t *hc, int rc, const char *content,
     }
   }
   if (hc->hc_logout_cookie == 1) {
-    htsbuf_append_str(&hdrs, "Set-Cookie: logout=1; Path=\"/logout\"\r\n");
+    htsbuf_qprintf(&hdrs, "Set-Cookie: logout=1; Path=\"%s/logout\"\r\n",
+                   tvheadend_webroot ? tvheadend_webroot : "");
   } else if (hc->hc_logout_cookie == 2) {
-    htsbuf_append_str(&hdrs, "Set-Cookie: logout=0; Path=\"/logout'\"; expires=Thu, 01 Jan 1970 00:00:00 GMT\r\n");
+    htsbuf_qprintf(&hdrs, "Set-Cookie: logout=0; Path=\"%s/logout'\"; expires=Thu, 01 Jan 1970 00:00:00 GMT\r\n",
+                   tvheadend_webroot ? tvheadend_webroot : "");
   }
 
   if (hc->hc_version != RTSP_VERSION_1_0)