Fix for the trailing slash when the "path" is empty

This fix should allow to get:
http://test.loc/
instead of
http://test.loc