Make federation endpoints more tolerant of trailing slashes for some endpoints#4793
Conversation
Codecov Report
@@ Coverage Diff @@
## develop #4793 +/- ##
===========================================
- Coverage 75.35% 74.34% -1.01%
===========================================
Files 340 340
Lines 34889 36025 +1136
Branches 5708 6105 +397
===========================================
+ Hits 26290 26784 +494
- Misses 6988 7589 +601
- Partials 1611 1652 +41 |
richvdh
left a comment
There was a problem hiding this comment.
I'm confused about this. How is it going to work against existing servers?
I suggest you start with a PR which just makes the incoming endpoints more tolerant. Then open a different PR to sort out the outgoing requests.
|
...good point. |
|
This may also be relevant: synapse/synapse/rest/client/v1/push_rule.py Lines 33 to 36 in aba5eea |
Factored out client changes to #4840
richvdh
left a comment
There was a problem hiding this comment.
the UTs seem to be failing for some reason
| """ | ||
| PATH = ( | ||
| "/groups/(?P<group_id>[^/]*)/categories/(?P<category_id>[^/]+)" | ||
| "/groups/(?P<group_id>[^/]*)/categories/(?P<category_id>[^/]+)/?" |
There was a problem hiding this comment.
I'm pretty sure we decided adding an optional / here was incorrect
There was a problem hiding this comment.
Correct, we decided to leave out groups for now.
| """ | ||
| PATH = ( | ||
| "/groups/(?P<group_id>[^/]*)/roles/(?P<role_id>[^/]+)" | ||
| "/groups/(?P<group_id>[^/]*)/roles/(?P<role_id>[^/]+)/?" |
richvdh
left a comment
There was a problem hiding this comment.
lgtm. Please squash-merge or I will hunt you down ;-)
Receiving side of a solution towards #3622.
Client portion here: #4840
Makes Synapse accept zero or more trailing slashes on the federation endpoints mentioned in #3622.