Uploaded image for project: 'OFBiz'
  1. OFBiz
  2. OFBIZ-10508

Remove checks to store only 250 characters of URL in VisitHandler.getVisit() & ServerHitBin.saveHit()

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Done
    • Release Branch 17.12, Trunk
    • 17.12.01
    • framework
    • None

    Description

      Found following checks to restrict "URL" fields for Visit and ServerHit entity:

      When storing ServerHit using ServerHitBin.saveHit() method

       

      serverHit.set("requestUrl", fullRequestUrl.length() > 250 ? fullRequestUrl.substring(0, 250) : fullRequestUrl);
      String referrerUrl = request.getHeader("Referer") != null ? request.getHeader("Referer") : "";
      
      serverHit.set("referrerUrl", referrerUrl.length() > 250 ? referrerUrl.substring(0, 250) : referrerUrl);
      
      

      When storing Visit using VisitHandler.getVisit() method

      if (initialRequest != null) visit.set("initialRequest", initialRequest.length() > 250 ? initialRequest.substring(0, 250) : initialRequest);
      if (initialReferrer != null) visit.set("initialReferrer", initialReferrer.length() > 250 ? initialReferrer.substring(0, 250) : initialReferrer);
      
      

      When the code was committed ( https://markmail.org/message/fgatg5qyeaibxjxk ) the "URL" field type had a size of 255 characters only which was later changed to 2000 characters ( https://markmail.org/message/anfree2nkyk3imln ).

      So, the above code logic to restrict no of characters can be removed now. 

       

      Attachments

        Activity

          People

            adityasharma Aditya Sharma
            adityasharma Aditya Sharma
            Votes:
            1 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: