mirror of
https://github.com/ankitects/anki.git
synced 2025-09-18 14:02:21 -04:00
Fix sync client ignoring directories (#2490)
* Fix sync client ignoring directories
Current implementation of the sync client does not properly send requests to a
self-hosted sync server if the URL has directories.
If the self-hosted sync URL is `https://example.org/foo/bar/`, Anki is expected
to send requests to `https://example.org/foo/bar/sync/hostKey`. Instead, it will
discard the directories and wrongly send requests to
`https://example.org/sync/hostKey`.
Fixes: e5d5d1d
("Fix panic with invalid sync server URL with port")
* Add XeR to contributors
This commit is contained in:
parent
fef2844d45
commit
0d58a04596
2 changed files with 2 additions and 1 deletions
|
@ -119,6 +119,7 @@ Ingemar Berg <github.com/ingemarberg>
|
|||
Ben Kerman <ben@kermanic.org>
|
||||
Euan Kemp <euank@euank.com>
|
||||
Kieran Black <kieranlblack@gmail.com>
|
||||
XeR <github.com/XeR>
|
||||
|
||||
********************
|
||||
|
||||
|
|
|
@ -90,7 +90,7 @@ impl TryFrom<pb::sync::SyncAuth> for SyncAuth {
|
|||
// are detected but URLs like computer.local:8000 are not.
|
||||
// By calling join() now, these URLs are detected too and later code that
|
||||
// uses and unwraps the result of join() doesn't panic
|
||||
.and_then(|x| x.join("/"))
|
||||
.and_then(|x| x.join("./"))
|
||||
.or_invalid("Invalid sync server specified. Please check the preferences.")
|
||||
})
|
||||
.transpose()?,
|
||||
|
|
Loading…
Reference in a new issue