summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--apps/patchwork/views/base.py4
-rw-r--r--templates/patchwork/pwclientrc2
2 files changed, 5 insertions, 1 deletions
diff --git a/apps/patchwork/views/base.py b/apps/patchwork/views/base.py
index 338c673..bb78fa4 100644
--- a/apps/patchwork/views/base.py
+++ b/apps/patchwork/views/base.py
@@ -47,6 +47,10 @@ def pwclientrc(request, project_id):
project = get_object_or_404(Project, linkname = project_id)
context = PatchworkRequestContext(request)
context.project = project
+ if request.is_secure():
+ context['scheme'] = 'https'
+ else:
+ context['scheme'] = 'http'
response = HttpResponse(mimetype = "text/plain")
response['Content-Disposition'] = 'attachment; filename=.pwclientrc'
response.write(render_to_string('patchwork/pwclientrc', context))
diff --git a/templates/patchwork/pwclientrc b/templates/patchwork/pwclientrc
index 5fb1f47..c932b11 100644
--- a/templates/patchwork/pwclientrc
+++ b/templates/patchwork/pwclientrc
@@ -4,7 +4,7 @@
# Save this file to ~/.pwclientrc
#
[base]
-url: http://{{site.domain}}{% url patchwork.views.xmlrpc.xmlrpc %}
+url: {{scheme}}://{{site.domain}}{% url patchwork.views.xmlrpc.xmlrpc %}
project: {{ project.linkname }}
{% if user.is_authenticated %}
# Adding authentication parameters will allow you to use the 'update'