mirror of
https://github.com/jointakahe/takahe.git
synced 2025-06-06 02:38:49 +00:00
Mitra Fixes (#207)
Don't send a list when populating Accept header. This seems to work fine on Mastodon and friends, and fixes a bug with the Mitra server until resolved upstream.
This commit is contained in:
parent
3544aa0c8b
commit
cfa97b9740
3 changed files with 4 additions and 2 deletions
|
@ -20,7 +20,7 @@ def sanitize_post(post_html: str) -> str:
|
||||||
Only allows a, br, p and span tags, and class attributes.
|
Only allows a, br, p and span tags, and class attributes.
|
||||||
"""
|
"""
|
||||||
cleaner = bleach.Cleaner(
|
cleaner = bleach.Cleaner(
|
||||||
tags=["br", "p"],
|
tags=["br", "p", "a"],
|
||||||
attributes={ # type:ignore
|
attributes={ # type:ignore
|
||||||
"a": allow_a,
|
"a": allow_a,
|
||||||
"p": ["class"],
|
"p": ["class"],
|
||||||
|
|
|
@ -200,7 +200,7 @@ class HttpSignature:
|
||||||
body_bytes = b""
|
body_bytes = b""
|
||||||
# GET requests get implicit accept headers added
|
# GET requests get implicit accept headers added
|
||||||
if method == "get":
|
if method == "get":
|
||||||
headers["Accept"] = "application/activity+json, application/ld+json"
|
headers["Accept"] = "application/activity+json"
|
||||||
# Sign the headers
|
# Sign the headers
|
||||||
signed_string = "\n".join(
|
signed_string = "\n".join(
|
||||||
f"{name.lower()}: {value}" for name, value in headers.items()
|
f"{name.lower()}: {value}" for name, value in headers.items()
|
||||||
|
|
|
@ -3,6 +3,8 @@ ARG IMAGE_LABEL=3.11.1-slim-buster
|
||||||
|
|
||||||
FROM ${IMAGE_HOST}:${IMAGE_LABEL}
|
FROM ${IMAGE_HOST}:${IMAGE_LABEL}
|
||||||
|
|
||||||
|
ENV PYTHONUNBUFFERED=1
|
||||||
|
|
||||||
RUN apt-get update \
|
RUN apt-get update \
|
||||||
&& apt-get install -y --no-install-recommends \
|
&& apt-get install -y --no-install-recommends \
|
||||||
libpq5 \
|
libpq5 \
|
||||||
|
|
Loading…
Reference in a new issue