If servletContextPath is not root (application is deployed not to the root) we should take it into consideration while determinating server base.

This commit is contained in:
petromykhailysyn 2016-01-22 10:42:36 +02:00
parent e73f409800
commit 0e3bb5a797
1 changed files with 6 additions and 1 deletions

View File

@ -73,7 +73,12 @@ public class IncomingRequestAddressStrategy implements IServerAddressStrategy {
}
String fhirServerBase;
int length = contextIndex + servletPath.length();
int length;
if (servletContextPath.length() == 0 || servletContextPath.equals("/")) {
length = contextIndex + servletPath.length();
} else {
length = contextIndex + servletPath.length() + servletContextPath.length();
}
if (length > requestUrlLength) {
length = requestUrlLength;
}