Commit b41006f6 authored by Markus Scheidgen's avatar Markus Scheidgen
Browse files

Minor fixes related to https support.

parent cb6eb672
Pipeline #46048 passed with stages
in 16 minutes and 8 seconds
......@@ -16,7 +16,7 @@
All APIs are served by one Flask app (:py:mod:`nomad.api.app`) under different paths.
"""
from flask import Flask, jsonify
from flask import Flask, jsonify, url_for
from flask_restplus import Api, fields
from flask_cors import CORS
from werkzeug.exceptions import HTTPException
......@@ -32,14 +32,14 @@ base_path = config.services.api_base_path
""" Provides the root path of the nomad APIs. """
@property
@property # type: ignore
def specs_url(self):
"""
Fixes issue where swagger-ui makes a call to swagger.json over HTTP.
This can ONLY be used on servers that actually use HTTPS. On servers that use HTTP,
this code should not be used at all.
"""
return flask.url_for(self.endpoint('specs'), _external=True, _scheme='https')
return url_for(self.endpoint('specs'), _external=True, _scheme='https')
if config.services.https:
......
export NOMAD_CLIENT_URL=http://labdev-nomad.esc.rzg.mpg.de/fairdi/nomad/migration/api
export NOMAD_CLIENT_URL=https://labdev-nomad.esc.rzg.mpg.de/fairdi/nomad/migration/api
export NOMAD_CLIENT_USER=admin
export NOMAD_FS_MIGRATION_PACKAGES=/nomad/fairdi/migration/fs/migration_packages
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment