How to normalize a URL in Java?

后端 未结 8 1177
孤独总比滥情好
孤独总比滥情好 2020-12-09 01:27

URL normalization (or URL canonicalization) is the process by which URLs are modified and standardized in a consistent manner. The goal of the normalization p

8条回答
  •  旧时难觅i
    2020-12-09 02:21

    No, there is nothing in the standard libraries to do this. Canonicalization includes things like decoding unnecessarily encoded characters, converting hostnames to lowercase, etc.

    e.g. http://ACME.com/./foo%26bar becomes:

    http://acme.com/foo&bar

    URI's normalize() does not do this.

提交回复
热议问题