问题
The implementation of Location.normalize
in Angular 2 strips trailing slashes from URLs (documentation). What is the reasoning behind this? Can I go ahead and override this behaviour if I wish? What are the potential consequences of doing so? I would prefer that normalized URLs have a trailing slash, in part for consistency with the API exposed by the back-end part of my project (reasoning).
Edit: I see that there is a commit against angular.js which allows the configuring of this behaviour; is it likely that Angular 2 will support this in future too? The documentation seems rather stipulative on the subject:
A normalized URL is absolute from the URL host, includes the application's base href, and has no trailing slash.
来源:https://stackoverflow.com/questions/38708191/normalized-url-strips-trailing-slash