mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 21:04:50 -04:00
Fix client IPs being broken on Python 3 (#3908)
This commit is contained in:
parent
3fd68d533b
commit
1f3f5fcf52
9 changed files with 238 additions and 58 deletions
|
@ -26,6 +26,7 @@ from twisted.internet.defer import Deferred
|
|||
from twisted.trial import unittest
|
||||
|
||||
from synapse.http.server import JsonResource
|
||||
from synapse.http.site import SynapseRequest
|
||||
from synapse.server import HomeServer
|
||||
from synapse.types import UserID, create_requester
|
||||
from synapse.util.logcontext import LoggingContextFilter
|
||||
|
@ -237,7 +238,9 @@ class HomeserverTestCase(TestCase):
|
|||
Function to optionally be overridden in subclasses.
|
||||
"""
|
||||
|
||||
def make_request(self, method, path, content=b""):
|
||||
def make_request(
|
||||
self, method, path, content=b"", access_token=None, request=SynapseRequest
|
||||
):
|
||||
"""
|
||||
Create a SynapseRequest at the path using the method and containing the
|
||||
given content.
|
||||
|
@ -255,7 +258,7 @@ class HomeserverTestCase(TestCase):
|
|||
if isinstance(content, dict):
|
||||
content = json.dumps(content).encode('utf8')
|
||||
|
||||
return make_request(method, path, content)
|
||||
return make_request(method, path, content, access_token, request)
|
||||
|
||||
def render(self, request):
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue