mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-01-12 02:19:27 -05:00
fix typos and needless try/except from PR review
This commit is contained in:
parent
83b2f83da0
commit
5ffacc5e84
@ -54,7 +54,7 @@ class PreviewUrlResource(BaseMediaResource):
|
|||||||
if html:
|
if html:
|
||||||
pass
|
pass
|
||||||
except:
|
except:
|
||||||
raise RunTimeError("Disabling PreviewUrlResource as lxml not available")
|
raise RuntimeError("Disabling PreviewUrlResource as lxml not available")
|
||||||
|
|
||||||
if not hasattr(hs.config, "url_preview_ip_range_blacklist"):
|
if not hasattr(hs.config, "url_preview_ip_range_blacklist"):
|
||||||
logger.warn(
|
logger.warn(
|
||||||
@ -62,7 +62,7 @@ class PreviewUrlResource(BaseMediaResource):
|
|||||||
"blacklist in url_preview_ip_range_blacklist for url previewing "
|
"blacklist in url_preview_ip_range_blacklist for url previewing "
|
||||||
"to work"
|
"to work"
|
||||||
)
|
)
|
||||||
raise RunTimeError(
|
raise RuntimeError(
|
||||||
"Disabling PreviewUrlResource as "
|
"Disabling PreviewUrlResource as "
|
||||||
"url_preview_ip_range_blacklist not specified"
|
"url_preview_ip_range_blacklist not specified"
|
||||||
)
|
)
|
||||||
@ -91,7 +91,6 @@ class PreviewUrlResource(BaseMediaResource):
|
|||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
def _async_render_GET(self, request):
|
def _async_render_GET(self, request):
|
||||||
|
|
||||||
try:
|
|
||||||
# XXX: if get_user_by_req fails, what should we do in an async render?
|
# XXX: if get_user_by_req fails, what should we do in an async render?
|
||||||
requester = yield self.auth.get_user_by_req(request)
|
requester = yield self.auth.get_user_by_req(request)
|
||||||
url = request.args.get("url")[0]
|
url = request.args.get("url")[0]
|
||||||
@ -240,8 +239,6 @@ class PreviewUrlResource(BaseMediaResource):
|
|||||||
)
|
)
|
||||||
|
|
||||||
respond_with_json_bytes(request, 200, json.dumps(og), send_cors=True)
|
respond_with_json_bytes(request, 200, json.dumps(og), send_cors=True)
|
||||||
except Exception as e:
|
|
||||||
raise e
|
|
||||||
|
|
||||||
|
|
||||||
@defer.inlineCallbacks
|
@defer.inlineCallbacks
|
||||||
|
Loading…
Reference in New Issue
Block a user