This pull request improves the way we detect whether the user is making use of the integration services or, in its absence, wiris.net.
Prior to the development, we used a hard-coded string to identify the route where the integration services were hosted. That is a correct approach for the PHP ones, but in Java the user can change their location, making it impossible to detect since it did not match the Java hard-coded string.
The approach is to make a request to the current viewer URL, if we are not on PHP and receive an answer, it means that the client is using the Java integration services. Otherwise, it will default to wiris.net.
Steps to reproduce
Case 1:
Using Plugins, deploy a Java demo with the instructions in the build/docker folder.
It should load properly the viewer from the location where the integration services are. Calls are not made to wiris.net, but to localhost.
Case 2:
Build and start a viewer demo with the html-integrations.
Check that the mentioned request to validate if we are in Java fails, and the following requests are made to wiris.net.
Description
This pull request improves the way we detect whether the user is making use of the integration services or, in its absence, wiris.net.
Prior to the development, we used a hard-coded string to identify the route where the integration services were hosted. That is a correct approach for the PHP ones, but in Java the user can change their location, making it impossible to detect since it did not match the Java hard-coded string.
The approach is to make a request to the current viewer URL, if we are not on PHP and receive an answer, it means that the client is using the Java integration services. Otherwise, it will default to wiris.net.
Steps to reproduce
Case 1:
build/docker
folder.Case 2:
#taskid 45038