Fix URL scheme on the authenticate header
This commit is contained in:
parent
e1b3e9e6ae
commit
f50ea3329a
1 changed files with 5 additions and 1 deletions
|
@ -15,6 +15,7 @@ from auth.permissions import (ReadRepositoryPermission, ModifyRepositoryPermissi
|
|||
AdministerRepositoryPermission)
|
||||
from data import model
|
||||
from util.http import abort
|
||||
from app import app
|
||||
|
||||
|
||||
|
||||
|
@ -68,7 +69,10 @@ def v2_support_enabled():
|
|||
response = make_response('true', 401)
|
||||
realm_hostname = urlparse(request.url).netloc
|
||||
realm_auth_path = url_for('v2.generate_registry_jwt')
|
||||
authenticate = 'Bearer realm="{0}{1}",service="quay"'.format(realm_hostname, realm_auth_path)
|
||||
scheme = app.config['PREFERRED_URL_SCHEME']
|
||||
|
||||
authenticate = 'Bearer realm="{0}://{1}{2}",service="quay"'.format(scheme, realm_hostname,
|
||||
realm_auth_path)
|
||||
response.headers['WWW-Authenticate'] = authenticate
|
||||
|
||||
response.headers['Docker-Distribution-API-Version'] = 'registry/2.0'
|
||||
|
|
Reference in a new issue