Fix bug when asset_host and base tag are present

Fixes a bug when asset_host and base tag are present, cherry picked from PR #1295 by @abotalov