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

Fix error when logging incomplete requests #3990

Merged
merged 2 commits into from Oct 2, 2018

Conversation

Projects
None yet
2 participants
@erikjohnston
Member

erikjohnston commented Oct 2, 2018

If a connection is lost before a request is read from Request, Twisted
sets method (and uri) attributes to dummy values. These dummy values
have incorrect types (i.e. they're not bytes), and so things like
__repr__ would raise an exception.

To fix this we had a helper method to return the method with a
consistent type.

@erikjohnston erikjohnston requested a review from matrix-org/synapse-core Oct 2, 2018

erikjohnston added some commits Oct 2, 2018

Fix error when logging incomplete requests
If a connection is lost before a request is read from Request, Twisted
sets `method` (and `uri`) attributes to dummy values. These dummy values
have incorrect types (i.e. they're not bytes), and so things like
`__repr__` would raise an exception.

To fix this we had a helper method to return the method with a
consistent type.
@richvdh

richvdh approved these changes Oct 2, 2018

looks sane to me.

@erikjohnston erikjohnston merged commit 0f7033f into develop Oct 2, 2018

6 checks passed

ci/circleci: sytestpy2merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy2postgresmerged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3merged Your tests passed on CircleCI!
Details
ci/circleci: sytestpy3postgresmerged Your tests passed on CircleCI!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment