Fix HDFS paths to be encoded properly (#7896)

This commit is contained in:
Charles Gagnon
2019-10-22 14:05:23 -07:00
committed by GitHub
parent 03cb0565d4
commit 8f2113e6b5

View File

@@ -73,10 +73,10 @@ export class WebHDFS {
*/
private getOperationEndpoint(operation: string, path: string, params?: object): string {
let endpoint = this._url;
endpoint.pathname = this._opts.path + path;
endpoint.pathname = encodeURI(this._opts.path + path);
let searchOpts = Object.assign(
{ 'op': operation },
// this._opts.user ? { 'user.name': this._opts.user } : {},
this._opts.user ? { 'user.name': this._opts.user } : {},
params || {}
);
endpoint.search = querystring.stringify(searchOpts);