Trailing whitespace in resource URLs not stripped

We should strip this, might lead to inadvertent errors.