T5763: fix imprecise check for remote file name
(cherry picked from commit fe9b08665367b8e7d9b906a0760d44efc9b5cafb)