add cache-control headers to /keys

This commit is contained in:
Jimmy Zelinskie 2016-01-12 17:58:21 -05:00
parent b515548f11
commit bcdbf0301d

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.csrf import csrf_protect, generate_csrf_token, verify_csrf
from endpoints.decorators import anon_protect, anon_allowed from endpoints.decorators import anon_protect, anon_allowed
from health.healthcheck import get_healthchecker 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.headers import parse_basic_auth
from util.invoice import renderInvoiceToPdf from util.invoice import renderInvoiceToPdf
from util.names import parse_repository_name, parse_repository_name_and_tag 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() return load_pem_x509_certificate(cert_file.read(), default_backend()).public_key()
@route_show_if(features.BITTORRENT) @route_show_if(features.BITTORRENT)
@cache_control(max_age=300)
@web.route('/keys', methods=['GET']) @web.route('/keys', methods=['GET'])
def jwk_set_uri(): def jwk_set_uri():
certificate = _load_certificate_bytes(app.config['JWT_AUTH_CERTIFICATE_PATH']) certificate = _load_certificate_bytes(app.config['JWT_AUTH_CERTIFICATE_PATH'])