kopia lustrzana https://github.com/snarfed/bridgy-fed
rodzic
a2d9dcb4a9
commit
55d5206188
|
@ -36,7 +36,7 @@ SUPPORTED_TYPES = (
|
|||
|
||||
|
||||
@app.get(f'/<regex("{common.DOMAIN_RE}"):domain>')
|
||||
@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)
|
||||
|
|
|
@ -16,7 +16,7 @@ LINK_HEADER = '<%s>; rel="webmention"'
|
|||
|
||||
|
||||
@app.get(r'/wm/<path:url>')
|
||||
@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)
|
||||
|
|
|
@ -42,7 +42,7 @@ _negotiator = ContentNegotiator(acceptable=[
|
|||
|
||||
|
||||
@app.get(r'/r/<path:to>')
|
||||
@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.
|
||||
|
||||
|
|
|
@ -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)
|
||||
|
||||
|
|
Ładowanie…
Reference in New Issue