normalized URL strips trailing slash

北慕城南 提交于 2019-12-24 00:23:02

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!