[
https://issues.apache.org/jira/browse/OFBIZ-10508?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16583950#comment-16583950 ]
Aditya Sharma commented on OFBIZ-10508:
---------------------------------------
Committed in
trunk r1838256
Backported to R17.12 r1838257
Removed null pointer check for initialRequest and initialReferrer as it is already handled while setting the values in UtilHttp.setInitialRequestInfo() method.
Thanks Jacques for the upvote :)
> Remove checks to store only 250 characters of URL in VisitHandler.getVisit() & ServerHitBin.saveHit()
> -----------------------------------------------------------------------------------------------------
>
> Key: OFBIZ-10508
> URL:
https://issues.apache.org/jira/browse/OFBIZ-10508> Project: OFBiz
> Issue Type: Improvement
> Components: framework
> Affects Versions: Trunk, Release Branch 17.12
> Reporter: Aditya Sharma
> Assignee: Aditya Sharma
> Priority: Major
>
> Found following checks to restrict "URL" fields for Visit and ServerHit entity:
> When storing ServerHit using ServerHitBin.saveHit() method
>
> {code:java}
> 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);
> {code}
> When storing Visit using VisitHandler.getVisit() method
> {code:java}
> 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);
> if (initialUserAgent != null) visit.set("initialUserAgent", initialUserAgent.length() > 250 ? initialUserAgent.substring(0, 250) : initialUserAgent);
> {code}
> 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.
>
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)