mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-02 13:46:02 -04:00
Include version in User-Agent and Server headers
This commit is contained in:
parent
420ccfc925
commit
24b5d01853
4 changed files with 35 additions and 6 deletions
|
@ -14,14 +14,16 @@
|
|||
# limitations under the License.
|
||||
|
||||
|
||||
from syutil.jsonutil import (
|
||||
encode_canonical_json, encode_pretty_printed_json
|
||||
)
|
||||
from synapse.http.agent_name import AGENT_NAME
|
||||
from synapse.api.errors import (
|
||||
cs_exception, SynapseError, CodeMessageException
|
||||
)
|
||||
from synapse.util.logcontext import LoggingContext
|
||||
|
||||
from syutil.jsonutil import (
|
||||
encode_canonical_json, encode_pretty_printed_json
|
||||
)
|
||||
|
||||
from twisted.internet import defer, reactor
|
||||
from twisted.web import server, resource
|
||||
from twisted.web.server import NOT_DONE_YET
|
||||
|
@ -230,6 +232,7 @@ def respond_with_json_bytes(request, code, json_bytes, send_cors=False,
|
|||
|
||||
request.setResponseCode(code, message=response_code_message)
|
||||
request.setHeader(b"Content-Type", b"application/json")
|
||||
request.setHeader(b"Server", AGENT_NAME)
|
||||
|
||||
if send_cors:
|
||||
request.setHeader("Access-Control-Allow-Origin", "*")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue