fix for hadoop-3733 compatible with RFC-3986 and simpler than the previous fix