From 177e4cd224386af4db6293eb7ab7f97c03374e92 Mon Sep 17 00:00:00 2001 From: Peter Elmers Date: Thu, 7 Dec 2017 17:26:09 -0800 Subject: [PATCH] Escape more symbols in path handling. --- src/language_server_api.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/language_server_api.cc b/src/language_server_api.cc index 4f0ad21a..31b73e44 100644 --- a/src/language_server_api.cc +++ b/src/language_server_api.cc @@ -223,9 +223,13 @@ void lsDocumentUri::SetPath(const std::string& path) { "%3A"); } + // subset of reserved characters from the URI standard + // http://www.ecma-international.org/ecma-262/6.0/#sec-uri-syntax-and-semantics raw_uri = ReplaceAll(raw_uri, " ", "%20"); raw_uri = ReplaceAll(raw_uri, "(", "%28"); raw_uri = ReplaceAll(raw_uri, ")", "%29"); + raw_uri = ReplaceAll(raw_uri, "#", "%23"); + raw_uri = ReplaceAll(raw_uri, ",", "%2C"); // TODO: proper fix #if defined(_WIN32)