matrix-org / complement

Matrix compliance test suite
Apache License 2.0
61 stars 52 forks source link

Content-Type check is too restrictive in "TestRegistration/parallel/POST_{}_returns_a_set_of_flows" #696

Open MTRNord opened 11 months ago

MTRNord commented 11 months ago

https://github.com/matrix-org/complement/blob/ad263aa5d0dfbd823d99e486642d71f402a07ffa/tests/csapi/apidoc_register_test.go#L50-L52

In "TestRegistration/parallel/POST_{}_returns_a_set_of_flows" the test strictly required application/json. It's common for many servers to return also a charset in the content type, which is valid according to HTTP. However, complement considers this as a failure which I discovered while testing https://github.com/MTRNord/persephone :)

❌ TestRegistration/parallel/POST_{}_returns_a_set_of_flows (0s) apidoc_register_test.go:48: MatchResponse got Content-Type: application/json; charset=utf-8 want application/json - http://127.0.0.1:32819/_matrix/client/v3/register => {"flows":[{"stages":["m.login.dummy"]}],"session":"Kbxte1cyWasGZdeIeBsf9FJax"}