]> git.openstreetmap.org Git - rails.git/commitdiff
Relative URLs seem to upset OAuth so use the host from the request
authorTom Hughes <tom@compton.nu>
Fri, 10 Dec 2010 14:20:24 +0000 (14:20 +0000)
committerTom Hughes <tom@compton.nu>
Fri, 10 Dec 2010 14:20:24 +0000 (14:20 +0000)
app/views/site/_potlatch2.html.erb

index 6073e0adf446e95c9156e56eaf2b9f92fc5ab200..e27164fa8ee8e54302233bcbf6d59d7a3935c56d 100644 (file)
@@ -28,8 +28,8 @@
     fo.addVariable('gpx' ,'<%= h(params['gpx']) %>');
     <% end %>
     fo.addVariable("zoom",zoom);
-    fo.addVariable("api","/api/<%= API_VERSION %>/");
-    fo.addVariable("policy","/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 %>");