kopia lustrzana https://github.com/snarfed/bridgy-fed
work around negotiator crash with Chrome's new Accept header
https://github.com/CottageLabs/negotiator/issues/6 . thanks for reporting @gregorlove!pull/354/head
rodzic
427cd917e0
commit
42853fadad
|
@ -76,7 +76,11 @@ def redir(to):
|
||||||
# check conneg, serve AS2 if requested
|
# check conneg, serve AS2 if requested
|
||||||
accept = request.headers.get('Accept')
|
accept = request.headers.get('Accept')
|
||||||
if accept:
|
if accept:
|
||||||
negotiated = _negotiator.negotiate(accept)
|
try:
|
||||||
|
negotiated = _negotiator.negotiate(accept)
|
||||||
|
except ValueError:
|
||||||
|
# work around https://github.com/CottageLabs/negotiator/issues/6
|
||||||
|
negotiated = None
|
||||||
if negotiated:
|
if negotiated:
|
||||||
type = str(negotiated.content_type)
|
type = str(negotiated.content_type)
|
||||||
if type in (CONTENT_TYPE_AS2, CONTENT_TYPE_AS2_LD):
|
if type in (CONTENT_TYPE_AS2, CONTENT_TYPE_AS2_LD):
|
||||||
|
|
Ładowanie…
Reference in New Issue