Added getTarget for handling of trailing slashes in target URL
Fixes issue #16691