SLING-6064 : Redirect servlet should encode url for redirecting

git-svn-id: https://svn.apache.org/repos/asf/sling/trunk@1788408 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java b/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
index 14050d1..2cbe9aa 100644
--- a/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
+++ b/src/main/java/org/apache/sling/servlets/get/impl/RedirectServlet.java
@@ -169,7 +169,7 @@
             // into an absolute URI.
             response.reset();
             response.setStatus(status);
-            response.setHeader("Location", targetPath);
+            response.setHeader("Location", response.encodeRedirectURL(targetPath));
             response.flushBuffer();
 
             return;