Is the purpose of this to strip off the trailing slash? It's not immediately clear how this behavior differs from the following case.