B4J Question Hello from Palo Alto Networks

Declan

Well-Known Member
Licensed User
Longtime User
I have a B4j TCP app running on my server which runs great and I receive data (2 Bytes) from remote devices on a given port.
However, at least once a day I receive the following on the port:
B4X:
User-Agent: Hello from Palo Alto Networks, find out more about our scans in https://docs-cortex.paloaltonetworks.com/r/1/Cortex-Xpanse/Scanning-activity
Accept-Encoding: gzip
This creates the following error:
B4X:
(StringIndexOutOfBoundsException) java.lang.StringIndexOutOfBoundsException: Range [-1, 0) out of bounds for length 219
How can I prevent this?
 

Daestrum

Expert
Licensed User
Longtime User
Could you not just check the remote IP address and ignore if from Cortex - they have listed the address to ignore here ignore these
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
How can I prevent this?
Hard to guess anything if you totally hide your code.

I would check the length of data given to be sure not to raise an StringIndexOutOfBoundsException

Learning coding may also help
 
Upvote 0
Top