Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
synapse
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Timo Ley
synapse
Commits
fc4f8f33
Commit
fc4f8f33
authored
6 years ago
by
Matthew Hodgson
Browse files
Options
Downloads
Patches
Plain Diff
replace invalid utf8 with \ufffd
parent
1c867f53
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
synapse/http/site.py
+2
-2
2 additions, 2 deletions
synapse/http/site.py
with
2 additions
and
2 deletions
synapse/http/site.py
+
2
−
2
View file @
fc4f8f33
...
@@ -111,7 +111,7 @@ class SynapseRequest(Request):
...
@@ -111,7 +111,7 @@ class SynapseRequest(Request):
# from a IDN servname in an auth header
# from a IDN servname in an auth header
authenticated_entity
=
self
.
authenticated_entity
authenticated_entity
=
self
.
authenticated_entity
if
authenticated_entity
is
not
None
:
if
authenticated_entity
is
not
None
:
authenticated_entity
=
authenticated_entity
.
decode
(
"
utf-8
"
)
authenticated_entity
=
authenticated_entity
.
decode
(
"
utf-8
"
,
"
replace
"
)
# ...or could be raw utf-8 bytes in the User-Agent header.
# ...or could be raw utf-8 bytes in the User-Agent header.
# N.B. if you don't do this, the logger explodes cryptically
# N.B. if you don't do this, the logger explodes cryptically
...
@@ -120,7 +120,7 @@ class SynapseRequest(Request):
...
@@ -120,7 +120,7 @@ class SynapseRequest(Request):
# c.f. https://github.com/matrix-org/synapse/issues/3471
# c.f. https://github.com/matrix-org/synapse/issues/3471
user_agent
=
self
.
get_user_agent
()
user_agent
=
self
.
get_user_agent
()
if
user_agent
is
not
None
:
if
user_agent
is
not
None
:
user_agent
=
user_agent
.
decode
(
"
utf-8
"
)
user_agent
=
user_agent
.
decode
(
"
utf-8
"
,
"
replace
"
)
self
.
site
.
access_logger
.
info
(
self
.
site
.
access_logger
.
info
(
"
%s - %s - {%s}
"
"
%s - %s - {%s}
"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment