← Back to team overview

zeya team mailing list archive

[PATCH] Using relative paths

 

Hi,

First off, thanks for this great project. I'm a long-time user of Subsonic and Ogg, but got tired of its Flash player and its need to transcode everything to Mp3... 

Now, for my issue : I'm interested in running Zeya behind an Apache reverse proxy, and under a subdirectory (ie. https://mydomain.com/zeya). However the javascript portion of Zeya currently assumes the application is always running at the root of the URL. Removing these two leading slashes solves my problem, and shouldn't have any negative impact.

Here is the patch :


diff --git a/resources/zeya.js b/resources/zeya.js
index 568753a..fac20a2 100644
--- a/resources/zeya.js
+++ b/resources/zeya.js
@@ -96,7 +96,7 @@ function plural(number) {
 // Returns an Audio object corresponding to the track with the given key.
 function get_stream(key) {
   var buffer_param = using_webkit ? 'buffered=true&' : '';
-  return new Audio('/getcontent?' + buffer_param + 'key=' + escape(key));
+  return new Audio('getcontent?' + buffer_param + 'key=' + escape(key));
 }
 
 function update_status_area() {
@@ -268,7 +268,7 @@ function render_collection() {
 // Request the collection from the server then render it.
 function load_collection() {
   var req = new XMLHttpRequest();
-  req.open('GET', '/getlibrary', true);
+  req.open('GET', 'getlibrary', true);
   req.onreadystatechange = function(e) {
     if (req.readyState == 4 && req.status == 200) {
       server_response = JSON.parse(req.responseText);


Thanks!

--
Jérôme Charaoui
Service informatique - Collège de Maisonneuve

Follow ups