`asset_path` respects SCRIPT_NAME.

Closes #2992 

The code on `3-2-stable` is very different but It should be an easy fix too.