Medium Vulnerabilities CodeFix: Revert [Ref ID: 108330]
[aaf/authz.git] / auth / auth-locate / src / main / java / org / onap / aaf / auth / locate / api / API_AAFAccess.java
index 7b23c89..2076e84 100644 (file)
@@ -53,9 +53,6 @@ import org.onap.aaf.cadi.client.Retryable;
 import org.onap.aaf.misc.env.APIException;
 import org.onap.aaf.misc.env.Env;
 import org.onap.aaf.misc.env.TimeTaken;
-import org.owasp.esapi.errors.AccessControlException;
-import org.owasp.esapi.reference.DefaultHTTPUtilities;
-import org.owasp.encoder.Encode;
 
 public class API_AAFAccess {
 //    private static String service, version, envContext;
@@ -107,7 +104,7 @@ public class API_AAFAccess {
                                         ServletOutputStream sos;
                                         try {
                                             sos = resp.getOutputStream();
-                                            sos.print(Encode.forJava(fp.value));
+                                            sos.print(fp.value);
                                         } catch (IOException e) {
                                             throw new CadiException(e);
                                         }
@@ -125,7 +122,7 @@ public class API_AAFAccess {
                         User u = (User)d.data.get(0);
                         resp.setStatus(u.code);
                         ServletOutputStream sos = resp.getOutputStream();
-                        sos.print(Encode.forJava(u.resp));
+                        sos.print(u.resp);
                     }
                 } finally {
                     tt.done();
@@ -259,7 +256,7 @@ public class API_AAFAccess {
         });
     }
 
-    private static void redirect(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp, LocateFacade context, Locator<URI> loc, String path) throws IOException, AccessControlException {
+    private static void redirect(AuthzTrans trans, HttpServletRequest req, HttpServletResponse resp, LocateFacade context, Locator<URI> loc, String path) throws IOException {
         try {
             if (loc.hasItems()) {
                 Item item = loc.best();
@@ -272,10 +269,8 @@ public class API_AAFAccess {
                     redirectURL.append('?');
                     redirectURL.append(str);
                 }
-                trans.info().log("Redirect to",redirectURL);
-                DefaultHTTPUtilities util = new DefaultHTTPUtilities();                
-                util.sendRedirect(redirectURL.toString());                
-                //resp.sendRedirect(redirectURL.toString());
+                trans.info().log("Redirect to",redirectURL);              
+                resp.sendRedirect(redirectURL.toString());
             } else {
                 context.error(trans, resp, Result.err(Result.ERR_NotFound,"No Locations found for redirection"));
             }