Prevent 405 Method Not Allowed

Prevent the `ProfileRestServlet` from handling requests intended for the
`ProfileFieldRestServlet`.

If a requester tried to call PUT `.../profile/@user:domain/(key_id?)` a
worker that did not mount `ProfileFieldRestServlet`, they would then
receive a `405 Method Not Allowed` instead of the expected `404 Not
Found`.
This commit is contained in:
Andrew Morgan
2026-03-24 13:10:54 +00:00
parent 86572c63ed
commit 322127102c
+1 -1
View File
@@ -58,7 +58,7 @@ def _read_propagate(hs: "HomeServer", request: SynapseRequest) -> bool:
class ProfileRestServlet(RestServlet):
PATTERNS = client_patterns("/profile/(?P<user_id>[^/]*)", v1=True)
PATTERNS = client_patterns("/profile/(?P<user_id>[^/]*)$", v1=True)
CATEGORY = "Event sending requests"
def __init__(self, hs: "HomeServer"):