details:   https://code.openbravo.com/erp/devel/pi/rev/f8a0698bec67
changeset: 34472:f8a0698bec67
user:      Asier Lostalé <asier.lostale <at> openbravo.com>
date:      Fri Jul 27 11:04:10 2018 +0200
summary:   fixed bug 39060: reports randomly not downloaded using different 
server names

  When a report is generated in server a response with the information to 
download
  it is sent back to client. This information included full url based on 
strDireccion
  value, this variable is not thread safe and in case of using differnt names it
  can take an unexpected value.

  Now instead of an absolute path, we send a relative path startring from 
context.

diffstat:

 src/org/openbravo/base/secureApp/HttpSecureAppServlet.java |  6 ++++--
 1 files changed, 4 insertions(+), 2 deletions(-)

diffs (23 lines):

diff -r 0c7bc541e28f -r f8a0698bec67 
src/org/openbravo/base/secureApp/HttpSecureAppServlet.java
--- a/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java        Fri Jul 
27 10:33:29 2018 +0200
+++ b/src/org/openbravo/base/secureApp/HttpSecureAppServlet.java        Fri Jul 
27 11:04:10 2018 +0200
@@ -1039,7 +1039,8 @@
       throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: PopUp Download");
-    String href = strDireccion + "/utility/DownloadReport.html?report=" + 
fileName;
+    String href = getServletContext().getContextPath() + 
"/utility/DownloadReport.html?report="
+        + fileName;
     XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
         "org/openbravo/base/secureApp/PopUp_Download").createXmlDocument();
     xmlDocument.setParameter("href", href);
@@ -1051,7 +1052,8 @@
       throws IOException, ServletException {
     if (log4j.isDebugEnabled())
       log4j.debug("Output: PopUp Download");
-    String href = strDireccion + "/utility/DownloadReport.html?report=" + 
fileName;
+    String href = getServletContext().getContextPath() + 
"/utility/DownloadReport.html?report="
+        + fileName;
     XmlDocument xmlDocument = xmlEngine.readXmlTemplate(
         
"org/openbravo/base/secureApp/PopUp_DownloadAndRefresh").createXmlDocument();
     xmlDocument.setParameter("href", href);

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to