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:
Tyler Kennedy 2022-12-19 06:21:04 -05:00 committed by GitHub
parent 3544aa0c8b
commit cfa97b9740
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 4 additions and 2 deletions

View File

@ -20,7 +20,7 @@ def sanitize_post(post_html: str) -> str:
Only allows a, br, p and span tags, and class attributes.
"""
cleaner = bleach.Cleaner(
tags=["br", "p"],
tags=["br", "p", "a"],
attributes={ # type:ignore
"a": allow_a,
"p": ["class"],

View File

@ -200,7 +200,7 @@ class HttpSignature:
body_bytes = b""
# GET requests get implicit accept headers added
if method == "get":
headers["Accept"] = "application/activity+json, application/ld+json"
headers["Accept"] = "application/activity+json"
# Sign the headers
signed_string = "\n".join(
f"{name.lower()}: {value}" for name, value in headers.items()

View File

@ -3,6 +3,8 @@ ARG IMAGE_LABEL=3.11.1-slim-buster
FROM ${IMAGE_HOST}:${IMAGE_LABEL}
ENV PYTHONUNBUFFERED=1
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
libpq5 \