synapse icon indicating copy to clipboard operation
synapse copied to clipboard

Synapse responds 204 to `OPTIONS` regardless of the endpoint actually existing

Open turt2live opened this issue 1 year ago • 0 comments

Description

When Synapse is approached with an OPTIONS request, it responds 204, always. It should be returning 404 M_UNRECOGNIZED for endpoints which don't exist at all, and 405 M_UNRECOGNIZED for non-client-server endpoints which do exist, as per the M_UNRECOGNIZED description at https://spec.matrix.org/v1.10/client-server-api/#common-error-codes

Synapse's current behaviour can cause endpoint discovery to be unreliable. For example, https://github.com/matrix-org/matrix-react-sdk/pull/12492 aims to use OPTIONS to discover sliding sync, but because Synapse always returns a success code, the react-sdk thinks sliding sync is supported (even though it's not, as of writing).

Steps to reproduce

  • curl -sv -X OPTIONS https://matrix-client.matrix.org/_matrix/client/this/path/does/not/exist

Homeserver

all

Synapse Version

at least 1.105.1

Installation Method

Other (please mention below)

Database

n/a

Workers

I don't know

Platform

n/a

Configuration

No response

Relevant log output

n/a

Anything else that would be useful to know?

No response

turt2live avatar May 03 '24 16:05 turt2live