element-hq / element-hq/element-ios

Element may use an extra / in path component (//_matrix/), is blocked by some reverse proxies

Open
#3,943 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
Swift
Stars
1.8k
Forks
544
PR merge metrics
PR metrics pending

Description

**Describe the bug**

The iOS client is performing some HTTP GET methods for media thumbnail downloads with paths beginning with `//_matrix/` instead of a single root slash, `/_matrix/`. This can cause the requests to be blocked by reverse proxies that filter everything except those requests which match `/_matrix/*` paths, which is the [recommended setup for deploying synapse behind a reverse proxy](https://github.com/matrix-org/synapse/blob/develop/docs/reverse_proxy.md).

Observed using OpenBSD relayd in front of synapse and configuring a http protocol like:

```
http protocol "homeserver" {
# tls settings...

block
pass path "/_matrix/*"
pass path "/_synapse/client/*"
}
```

Adding an additional pass rule for `"//_matrix/*"` allowed the blocked requests to pass. All of the blocked requests I saw were for media thumbnails, beginning with `//_matrix/media/v1/thumbnail/`.

**Expected behavior**
Requests succeed with recommended reverse proxy configs.

**Smartphone (please complete the following information):**
- Device: iPhone XS
- OS: iOS 14.4 beta 2

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.