Web request error with any 172.x.x.x IP Address

fixed

#1

I am new to webCoRE and this is my first project so perhaps there is an issue on my end somewhere.

When attempting to perform a web request using ANY 172.x.x.x IP address I get the following error:

Error executing virtual command [].httpRequest: (6ms) java.lang.StringIndexOutOfBoundsException: String index out of range: -2

If I use ANY IP address outside of the 172.x.x.x block the request works as expected. My home network is on the 172.31.x.x network so perhaps there is a connection somehow.

This problem can be recreated by simply executing a POST request to http://172.1.1.1. Method and Content Type do not make a difference.

After further testing I’ve edited this post to reflect that the error occurs on any 172.x.x.x address not just those that are in the RFC1918 172.16.0.0 – 172.31.255.255 block.

Thanks,
Tom


#2

I found the source of the error. There is a bug on line 3220 in the webcore-piston.src file. (v0.2.100.20171211)

Line 3220 is: "def b = uri.substring(4,2)"
What it should be is: “def b = uri.substring(4,6)”

Thanks,
Tom


#3

@webCoRE_Minions


#4

Thanks for the code fix! Are you familiar with GitHub and willing to submit a pull request with this change? Otherwise I’ll make the change next week and roll that into the next update.


#5

@tbam well done! Your pull request to fix this bug has been deployed in today’s v0.2.101.20171227 update.