From: Tom Hughes Date: Fri, 10 Dec 2010 14:20:24 +0000 (+0000) Subject: Relative URLs seem to upset OAuth so use the host from the request X-Git-Tag: live~6251^2^2~50 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/da4c9cdfd9076e7a9cf9c623bf3010ac19a1148b Relative URLs seem to upset OAuth so use the host from the request --- diff --git a/app/views/site/_potlatch2.html.erb b/app/views/site/_potlatch2.html.erb index 6073e0adf..e27164fa8 100644 --- a/app/views/site/_potlatch2.html.erb +++ b/app/views/site/_potlatch2.html.erb @@ -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 %>");