XNAT-3453 Rolled back previous fix, as this prevented passing query-string parameters on the URL. Added check for
remaining part of URI. Created support method in SecureResource to allow for reuse.