Fix a trailing slash error in SCRIPT_NAME handling.

The previous commit broken the `/slides` endpoint if `SCRIPT_NAME` has a trailing slash.