@@ -16,12 +16,12 @@ namespace DB
1616
1717struct URIConverter
1818{
19- static void modifyURI (Poco::URI & uri, std::unordered_map<std::string, std::string> mapper)
19+ static void modifyURI (Poco::URI & uri, std::unordered_map<std::string, std::string> mapper, bool enable_url_encoding )
2020 {
2121 Macros macros ({{" bucket" , uri.getHost ()}});
2222 uri = macros.expand (mapper[uri.getScheme ()]).empty ()
2323 ? uri
24- : Poco::URI (macros.expand (mapper[uri.getScheme ()]) + uri.getPathAndQuery ());
24+ : Poco::URI (macros.expand (mapper[uri.getScheme ()]) + uri.getPathAndQuery (), enable_url_encoding );
2525 }
2626};
2727
@@ -33,7 +33,7 @@ namespace ErrorCodes
3333namespace S3
3434{
3535
36- URI::URI (const std::string & uri_, bool allow_archive_path_syntax)
36+ URI::URI (const std::string & uri_, bool allow_archive_path_syntax, bool enable_url_encoding )
3737{
3838 // / Case when bucket name represented in domain name of S3 URL.
3939 // / E.g. (https://bucket-name.s3.region.amazonaws.com/key)
@@ -55,7 +55,7 @@ URI::URI(const std::string & uri_, bool allow_archive_path_syntax)
5555 else
5656 uri_str = uri_;
5757
58- uri = Poco::URI (uri_str);
58+ uri = Poco::URI (uri_str, enable_url_encoding );
5959
6060 std::unordered_map<std::string, std::string> mapper;
6161 auto context = Context::getGlobalContextInstance ();
@@ -77,7 +77,7 @@ URI::URI(const std::string & uri_, bool allow_archive_path_syntax)
7777 }
7878
7979 if (!mapper.empty ())
80- URIConverter::modifyURI (uri, mapper);
80+ URIConverter::modifyURI (uri, mapper, enable_url_encoding );
8181 }
8282
8383 storage_name = " S3" ;
0 commit comments