[dolphin] [Bug 443386] New: Cannot rename or move file when add port information as 80 or 443 to webdav address, (Destination mismatch Host in header when added port info)

bugzilla_noreply at kde.org bugzilla_noreply at kde.org
Wed Oct 6 10:12:13 BST 2021


https://bugs.kde.org/show_bug.cgi?id=443386

            Bug ID: 443386
           Summary: Cannot rename or move file when add port information
                    as 80 or 443 to webdav address, (Destination mismatch
                    Host in header when added port info)
           Product: dolphin
           Version: 21.08.1
          Platform: unspecified
                OS: Linux
            Status: REPORTED
          Severity: normal
          Priority: NOR
         Component: general
          Assignee: dolphin-bugs-null at kde.org
          Reporter: leafee98 at hotmail.com
                CC: kfm-devel at kde.org
  Target Milestone: ---

SUMMARY

It's ok to rename a file when I enter `webdav://192.168.99.174/webdav/`,
`webdav://pub@192.168.99.174/webdav/` or
`webdavs://pub@192.168.99.174/webdav/`. But it came to error when I add the
port information like `webdav://192.168.99.174:80/webdav/` or
`webdavs://192.168.99.174:443/webdav` and it prompt "Unable to move the
specified file or folder because the destination server refuses to accept the
file or folder.". 

If the port is not 80 or 443, everything will be ok.

STEPS TO REPRODUCE
1. Run sftpgo with webdav listen http on 80 or https on 443
2. Type in webdav://localhost:80 or webdavs://localhost:443 and enter. If no
login prompt use webdav://user@localhost:80 or webdavs://user@localhost:443
3. Rename a file

OBSERVED RESULT

Prompt "Unable to move the specified file or folder because the destination
server refuses to accept the file or folder."

EXPECTED RESULT

No any error message occurred and file get renamed.

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: Arch linux
(available in About System)
KDE Plasma Version: 5.22.5
KDE Frameworks Version: 5.86.0
Qt Version: 5.15.2

ADDITIONAL INFORMATION

I use Apache httpd to proxy sftpgo's webdav reversely, both https and http
traffic are proxyed to plain http `http://localhost:8082` which is the sftpgo's
location.

The configuration of Apache httpd is below. The `RequestHeader` will make https
protocol to http in Header Destination, and `ProxyPreserveHost` will hold the
Host after `ProxyPass`.

```
Redirect /webdav /webdav/
RequestHeader edit Destination ^https: http: early
<Location /webdav/>
    ProxyPreserveHost On

    ProxyPass http://localhost:8082/webdav/
    ProxyPassReverse http://localhost:8082/webdav/
</Location>
```

The Apache httpd's critical log I got from `dumpio_module` with
`webdavs://pub@192.168.99.174:443/webdav/` is follow. The log at
[15:17:05.912107] shows that the Destination is different from Host as it add
the port 443, which case the Destination in proxyed request still keep the
difference with Host (log at [15:17:05.915961] and [15:17:05.914964]). So the
sftpgo respond a 502 error (sftpgo will respond 502 if the Host mismatch
Destination, see at
https://github.com/drakkan/sftpgo/issues/337#issuecomment-792250017).

```
[Wed Oct 06 15:17:05.910306 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): MOVE /webdav/nya HTTP/1.1\r\n
[Wed Oct 06 15:17:05.910529 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): Host: 192.168.99.174\r\n
[Wed Oct 06 15:17:05.910790 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): Connection: keep-alive\r\n
[Wed Oct 06 15:17:05.910923 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): User-Agent: Mozilla/5.0 (X11; Linux x86_64) KIO/5.86
dolphin/21.08.1\r\n
[Wed Oct 06 15:17:05.911054 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): Pragma: no-cache\r\n
[Wed Oct 06 15:17:05.911290 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): Cache-control: no-cache\r\n
[Wed Oct 06 15:17:05.911448 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): Accept: text/html, text/*;q=0.9, image/jpeg;q=0.9,
image/png;q=0.9, image/*;q=0.9, */*;q=0.8\r\n
[Wed Oct 06 15:17:05.911605 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): Accept-Encoding: gzip, deflate, x-gzip, x-deflate\r\n
[Wed Oct 06 15:17:05.911741 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): Accept-Charset: utf-8,*;q=0.5\r\n
[Wed Oct 06 15:17:05.911866 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): Accept-Language: en-US,en;q=0.9\r\n
[Wed Oct 06 15:17:05.911987 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): Authorization: Basic XXXXXXXXXXXXXXXX\r\n
[Wed Oct 06 15:17:05.912107 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): Destination:
https://pub@192.168.99.174:443/webdav/new-name\r\n
[Wed Oct 06 15:17:05.912234 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): Depth: infinity\r\n
[Wed Oct 06 15:17:05.912504 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): Overwrite: F\r\n
[Wed Oct 06 15:17:05.912644 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_in
(data-TRANSIENT): \r\n
[Wed Oct 06 15:17:05.914890 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
MOVE /webdav/nya HTTP/1.1\r\n
[Wed Oct 06 15:17:05.914964 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
Host: 192.168.99.174\r\n
[Wed Oct 06 15:17:05.915048 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
User-Agent: Mozilla/5.0 (X11; Linux x86_64) KIO/5.86 dolphin/21.08.1\r\n
[Wed Oct 06 15:17:05.915127 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
Pragma: no-cache\r\n
[Wed Oct 06 15:17:05.915199 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
Cache-control: no-cache\r\n
[Wed Oct 06 15:17:05.915279 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
Accept: text/html, text/*;q=0.9, image/jpeg;q=0.9, image/png;q=0.9,
image/*;q=0.9, */*;q=0.8\r\n
[Wed Oct 06 15:17:05.915358 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
Accept-Encoding: gzip, deflate, x-gzip, x-deflate\r\n
[Wed Oct 06 15:17:05.915580 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
Accept-Charset: utf-8,*;q=0.5\r\n
[Wed Oct 06 15:17:05.915658 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
Accept-Language: en-US,en;q=0.9\r\n
[Wed Oct 06 15:17:05.915735 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
Authorization: Basic XXXXXXXXXXXXXXXXr\n
[Wed Oct 06 15:17:05.915812 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
Depth: infinity\r\n
[Wed Oct 06 15:17:05.915886 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
Overwrite: F\r\n
[Wed Oct 06 15:17:05.915961 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
Destination: http://pub@192.168.99.174:443/webdav/new-name\r\n
[Wed Oct 06 15:17:05.916064 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
X-Forwarded-For: 192.168.99.161\r\n
[Wed Oct 06 15:17:05.916142 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
X-Forwarded-Host: 192.168.99.174\r\n
[Wed Oct 06 15:17:05.916216 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
X-Forwarded-Server: ::1\r\n
[Wed Oct 06 15:17:05.916289 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out (data-POOL):
Connection: Keep-Alive\r\n
[Wed Oct 06 15:17:05.916364 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_out
(data-IMMORTAL): \r\n
[Wed Oct 06 15:17:05.918887 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_in (data-HEAP):
HTTP/1.1 502 Bad Gateway\r\n
[Wed Oct 06 15:17:05.919171 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_in (data-HEAP):
Date: Wed, 06 Oct 2021 07:17:05 GMT\r\n
[Wed Oct 06 15:17:05.919305 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_in (data-HEAP):
C
[Wed Oct 06 15:17:05.919553 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_in (data-HEAP):
C
[Wed Oct 06 15:17:05.919626 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_in (data-HEAP):
ontent-Length: 11\r\n
[Wed Oct 06 15:17:05.919760 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_in (data-HEAP):
C
[Wed Oct 06 15:17:05.919955 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_in (data-HEAP):
C
[Wed Oct 06 15:17:05.920029 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_in (data-HEAP):
ontent-Type: text/plain; charset=utf-8\r\n
[Wed Oct 06 15:17:05.920281 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_in (data-HEAP):
\r
[Wed Oct 06 15:17:05.920487 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_in (data-HEAP):
\r
[Wed Oct 06 15:17:05.920561 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_in (data-HEAP):
\n
[Wed Oct 06 15:17:05.920808 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [remote 127.0.0.1:8082] mod_dumpio:  dumpio_in (data-HEAP):
Bad Gateway
[Wed Oct 06 15:17:05.921365 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_out
(data-HEAP): HTTP/1.1 502 Bad Gateway\r\nDate: Wed, 06 Oct 2021 07:17:05
GMT\r\nServer: Apache/2.4.48 (Debian)\r\nContent-Length: 11\r\nContent-Type:
text/plain; charset=utf-8\r\nKeep-Alive: timeout=5, max=98\r\nConnection:
Keep-Alive\r\n\r\n
[Wed Oct 06 15:17:05.921564 2021] [dumpio:trace7] [pid 160497]
mod_dumpio.c(100): [client 192.168.99.161:54428] mod_dumpio:  dumpio_out
(data-HEAP): Bad Gateway
```

If no Apache httpd as reverse proxy and let sftpgo listen 443 directly, the
rename operation still failed with `webdavs://192.168.99.174:443/webdav/`.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


More information about the kfm-devel mailing list