matrix-org / matrix-org/complement

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

Open
#696 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
99
Forks
72
Avg merge
4d 1h
Merged PRs (30d)
8

Description

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"}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with tests/csapi/apidoc_register_test.go around lines 50-52 and run TestRegistration/parallel/POST_{}_returns_a_set_of_flows. Check how the response Content-Type is matched, then verify the test accepts the valid charset example while still checking the media type.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
testing-qa
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
48/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.