Skip to content

Commit

Permalink
Better make use of base_path
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh Glick committed Feb 9, 2015
1 parent ee6e4a6 commit 8bd8e95
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions rest_framework_swagger/views.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ def get(self, request, *args, **kwargs):
template_name = SWAGGER_SETTINGS.get('template_path')
data = {
'swagger_settings': {
'discovery_url': SWAGGER_SETTINGS.get('base_path', '') or "%sapi-docs/" % request.build_absolute_uri(),
'discovery_url': "%sapi-docs/" % SWAGGER_SETTINGS.get('base_path', '') or request.build_absolute_uri(),
'api_key': SWAGGER_SETTINGS.get('api_key', ''),
'token_type': SWAGGER_SETTINGS.get('token_type'),
'enabled_methods': mark_safe(
Expand Down Expand Up @@ -97,7 +97,7 @@ def get(self, request):
return Response({
'apiVersion': SWAGGER_SETTINGS.get('api_version', ''),
'swaggerVersion': '1.2',
'basePath': SWAGGER_SETTINGS.get('base_path', '') or self.host.rstrip('/'),
'basePath': "%sapi-docs" % SWAGGER_SETTINGS.get('base_path', '') or self.host.rstrip('/'),
'apis': apis,
'info': SWAGGER_SETTINGS.get('info', {
'contact': '',
Expand Down

0 comments on commit 8bd8e95

Please sign in to comment.