mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-09-21 06:04:44 -04:00
Removed http_server from HomeServer. Updated unit tests to use either resource_for_federation or resource_for_client depending on what is being tested.
This commit is contained in:
parent
29aa13f0d4
commit
9a1638ed21
12 changed files with 21 additions and 30 deletions
|
@ -24,7 +24,7 @@ from twisted.python.log import PythonLoggingObserver
|
|||
from twisted.web.resource import Resource
|
||||
from twisted.web.static import File
|
||||
from twisted.web.server import Site
|
||||
from synapse.http.server import TwistedHttpServer, JsonResource
|
||||
from synapse.http.server import JsonResource
|
||||
from synapse.http.client import TwistedHttpClient
|
||||
from synapse.rest.base import CLIENT_PREFIX
|
||||
from synapse.federation.transport import PREFIX
|
||||
|
@ -40,8 +40,6 @@ logger = logging.getLogger(__name__)
|
|||
|
||||
|
||||
class SynapseHomeServer(HomeServer):
|
||||
def build_http_server(self):
|
||||
return TwistedHttpServer()
|
||||
|
||||
def build_http_client(self):
|
||||
return TwistedHttpClient()
|
||||
|
|
|
@ -52,10 +52,9 @@ class HttpServer(object):
|
|||
pass
|
||||
|
||||
|
||||
# The actual HTTP server impl, using twisted http server
|
||||
class TwistedHttpServer(HttpServer, resource.Resource):
|
||||
""" This wraps the twisted HTTP server, and triggers the correct callbacks
|
||||
on the transport_layer.
|
||||
class JsonResource(HttpServer, resource.Resource):
|
||||
""" This implements the HttpServer interface and provides JSON support for
|
||||
Resources.
|
||||
|
||||
Register callbacks via register_path()
|
||||
"""
|
||||
|
@ -185,8 +184,3 @@ def respond_with_json_bytes(request, code, json_bytes, send_cors=False):
|
|||
request.write(json_bytes)
|
||||
request.finish()
|
||||
return NOT_DONE_YET
|
||||
|
||||
|
||||
# FIXME: Temp, just so the new name can be used without breaking the world.
|
||||
class JsonResource(TwistedHttpServer):
|
||||
pass
|
|
@ -55,7 +55,6 @@ class BaseHomeServer(object):
|
|||
|
||||
DEPENDENCIES = [
|
||||
'clock',
|
||||
'http_server',
|
||||
'http_client',
|
||||
'db_pool',
|
||||
'persistence_service',
|
||||
|
@ -138,7 +137,9 @@ class HomeServer(BaseHomeServer):
|
|||
required.
|
||||
|
||||
It still requires the following to be specified by the caller:
|
||||
http_server
|
||||
resource_for_client
|
||||
resource_for_web_client
|
||||
resource_for_federation
|
||||
http_client
|
||||
db_pool
|
||||
"""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue