From 4a4ea52041a6e38ca619f94a6701c3ff55246b4d Mon Sep 17 00:00:00 2001 From: jakedt Date: Wed, 26 Mar 2014 16:37:28 -0400 Subject: [PATCH] Use the URL scheme and use the host in the other discovery url. --- endpoints/api/discovery.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/endpoints/api/discovery.py b/endpoints/api/discovery.py index 0b66c41aa..212d6654e 100644 --- a/endpoints/api/discovery.py +++ b/endpoints/api/discovery.py @@ -23,6 +23,9 @@ TYPE_CONVERTER = { int: 'integer', } +URL_SCHEME = app.config['URL_SCHEME'] +URL_HOST = app.config['URL_HOST'] + def fully_qualified_name(method_view_class): inst = method_view_class() @@ -140,7 +143,7 @@ def swagger_route_data(include_internal=False, compact=False): swagger_data = { 'apiVersion': 'v1', 'swaggerVersion': '1.2', - 'basePath': 'http://localhost:5000', + 'basePath': '%s://%s' % (URL_SCHEME, URL_HOST), 'resourcePath': '/', 'info': { 'title': 'Quay.io API', @@ -157,7 +160,7 @@ def swagger_route_data(include_internal=False, compact=False): "implicit": { "tokenName": "access_token", "loginEndpoint": { - "url": "http://%s/oauth/authorize" % app.config['URL_HOST'], + "url": "%s://%s/oauth/authorize" % (URL_SCHEME, URL_HOST), }, }, },