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>')
|
@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):
|
def actor(domain):
|
||||||
"""Fetches a domain's h-card and converts to AS2 actor."""
|
"""Fetches a domain's h-card and converts to AS2 actor."""
|
||||||
_, _, actor, _ = common.actor(domain)
|
_, _, actor, _ = common.actor(domain)
|
||||||
|
|
|
@ -16,7 +16,7 @@ LINK_HEADER = '<%s>; rel="webmention"'
|
||||||
|
|
||||||
|
|
||||||
@app.get(r'/wm/<path:url>')
|
@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):
|
def add_wm(url=None):
|
||||||
"""Proxies HTTP requests and adds Link header to our webmention endpoint."""
|
"""Proxies HTTP requests and adds Link header to our webmention endpoint."""
|
||||||
url = urllib.parse.unquote(url)
|
url = urllib.parse.unquote(url)
|
||||||
|
|
|
@ -42,7 +42,7 @@ _negotiator = ContentNegotiator(acceptable=[
|
||||||
|
|
||||||
|
|
||||||
@app.get(r'/r/<path:to>')
|
@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):
|
def redir(to):
|
||||||
"""301 redirect to the embedded fully qualified URL.
|
"""301 redirect to the embedded fully qualified URL.
|
||||||
|
|
||||||
|
|
|
@ -29,7 +29,7 @@ class Actor(flask_util.XrdOrJrd):
|
||||||
|
|
||||||
TODO: unify with common.actor()
|
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):
|
def dispatch_request(self, *args, **kwargs):
|
||||||
return super().dispatch_request(*args, **kwargs)
|
return super().dispatch_request(*args, **kwargs)
|
||||||
|
|
||||||
|
|
Ładowanie…
Reference in New Issue