diff --git a/activitypub.py b/activitypub.py index ccb8655..f832d51 100644 --- a/activitypub.py +++ b/activitypub.py @@ -36,7 +36,7 @@ SUPPORTED_TYPES = ( @app.get(f'/') -@flask_util.cached(cache, CACHE_TIME) +@flask_util.cached(cache, CACHE_TIME, http_5xx=True) def actor(domain): """Fetches a domain's h-card and converts to AS2 actor.""" _, _, actor, _ = common.actor(domain) diff --git a/add_webmention.py b/add_webmention.py index 9815fb7..a64953b 100644 --- a/add_webmention.py +++ b/add_webmention.py @@ -16,7 +16,7 @@ LINK_HEADER = '<%s>; rel="webmention"' @app.get(r'/wm/') -@flask_util.cached(cache, common.CACHE_TIME) +@flask_util.cached(cache, common.CACHE_TIME, http_5xx=True) def add_wm(url=None): """Proxies HTTP requests and adds Link header to our webmention endpoint.""" url = urllib.parse.unquote(url) diff --git a/redirect.py b/redirect.py index e207620..e9530b5 100644 --- a/redirect.py +++ b/redirect.py @@ -42,7 +42,7 @@ _negotiator = ContentNegotiator(acceptable=[ @app.get(r'/r/') -@flask_util.cached(cache, CACHE_TIME, headers=['Accept']) +@flask_util.cached(cache, CACHE_TIME, headers=['Accept'], http_5xx=True) def redir(to): """301 redirect to the embedded fully qualified URL. diff --git a/webfinger.py b/webfinger.py index 763bde1..0890eff 100644 --- a/webfinger.py +++ b/webfinger.py @@ -29,7 +29,7 @@ class Actor(flask_util.XrdOrJrd): TODO: unify with common.actor() """ - @flask_util.cached(cache, common.CACHE_TIME, headers=['Accept']) + @flask_util.cached(cache, common.CACHE_TIME, headers=['Accept'], http_5xx=True) def dispatch_request(self, *args, **kwargs): return super().dispatch_request(*args, **kwargs)