iRule - XFF different case based on direction

I have an issue with Bitbucket versions where XFF is sent differently depending on the direction of traffic between versions.  I am sure other apps have this issue as well.   Bitbucket versions ( v7.2.5 --> v8.19.3  )

Can the XFF type case-sensitivity be controlled based on direction.  (Right side is a mixed up standard and all upper-case versus the left side is all lower-case.

By direction do you mean what the client sends to the server vs what the server sends the client?

If requestor sends X, I need x (lower-case) to be received and vice versa.