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

View File

@ -73,7 +73,12 @@ public class IncomingRequestAddressStrategy implements IServerAddressStrategy {
} }
String fhirServerBase; 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) { if (length > requestUrlLength) {
length = requestUrlLength; length = requestUrlLength;
} }