Merge pull request #1144 from jzelinskie/cache-keys

add cache-control headers to /keys
This commit is contained in:
Jimmy Zelinskie 2016-01-12 18:01:04 -05:00
commit c7d281d097

View file

@ -29,7 +29,7 @@ from endpoints.common import common_login, render_page_template, route_show_if,
from endpoints.csrf import csrf_protect, generate_csrf_token, verify_csrf
from endpoints.decorators import anon_protect, anon_allowed
from health.healthcheck import get_healthchecker
from util.cache import no_cache
from util.cache import no_cache, cache_control
from util.headers import parse_basic_auth
from util.invoice import renderInvoiceToPdf
from util.names import parse_repository_name, parse_repository_name_and_tag
@ -692,6 +692,7 @@ def _load_certificate_bytes(certificate_file_path):
return load_pem_x509_certificate(cert_file.read(), default_backend()).public_key()
@route_show_if(features.BITTORRENT)
@cache_control(max_age=300)
@web.route('/keys', methods=['GET'])
def jwk_set_uri():
certificate = _load_certificate_bytes(app.config['JWT_AUTH_CERTIFICATE_PATH'])