]> git.openstreetmap.org Git - rails.git/blobdiff - app/views/site/_potlatch2.html.erb
Relative URLs seem to upset OAuth so use the host from the request
[rails.git] / app / views / site / _potlatch2.html.erb
index a72975dd73985e72fc34559d93ab4d2fd04b5e72..e27164fa8ee8e54302233bcbf6d59d7a3935c56d 100644 (file)
@@ -28,8 +28,8 @@
     fo.addVariable('gpx' ,'<%= h(params['gpx']) %>');
     <% end %>
     fo.addVariable("zoom",zoom);
-    fo.addVariable("api","http://<%= SERVER_URL %>/api/<%= API_VERSION %>/");
-    fo.addVariable("policy","http://<%= SERVER_URL %>/api/crossdomain.xml");
+    fo.addVariable("api","<%= request.protocol + request.host_with_port %>/api/<%= API_VERSION %>/");
+    fo.addVariable("policy","<%= request.protocol + request.host_with_port %>/api/crossdomain.xml");
     fo.addVariable("connection","XML");
     fo.addVariable("oauth_token","<%= token.token %>");
     fo.addVariable("oauth_token_secret","<%= token.secret %>");