Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TestRoomCreationReportsEventsToMyself: Provide an empty json dict to /createRoom instead of no body #36

Merged
merged 1 commit into from
Nov 9, 2020

Conversation

anoadragon453
Copy link
Member

@anoadragon453 anoadragon453 commented Nov 9, 2020

As Synapse would otherwise complain that the provided body (of nothing) would not be JSON:

    client.go:200: Making POST request to http://localhost:33066/_matrix/client/r0/createRoom?access_token=xxx
    client.go:200: Request body: null
    client.go:266: POST /_matrix/client/r0/createRoom => 400 Bad Request (8.18542ms)
    client.go:200: HTTP/1.1 400 Bad Request
        Transfer-Encoding: chunked
        Access-Control-Allow-Headers: Origin, X-Requested-With, Content-Type, Accept, Authorization
        Access-Control-Allow-Methods: GET, HEAD, POST, PUT, DELETE, OPTIONS
        Access-Control-Allow-Origin: *
        Cache-Control: no-cache, no-store, must-revalidate
        Content-Type: application/json
        Date: Mon, 09 Nov 2020 13:34:38 GMT
        Server: Synapse/1.22.1
        
        41
        {"errcode":"M_BAD_JSON","error":"Content must be a JSON object."}
        0

I considered just changing client.Do to treat a nil jsonBody parameter as struct{}{}, but then realised that there probably are cases where we we want to test without sending a JSON body :)

I've confirmed that Dendrite still passes all tests even with this change.

@kegsay kegsay merged commit 9636e41 into master Nov 9, 2020
anoadragon453 added a commit that referenced this pull request Nov 17, 2020
* 'master' of github.com:matrix-org/complement:
  Add request query parameter map to instruction struct (#37)
  Add CA generation and mount it to /ca in containers (#28)
  Federation: return Content-Type header of 'application/json' by default (#35)
  Up the default version check iterations from 50 to 100 (#34)
  Provide an empty json dict to /createRoom instead of no body (#36)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants