Skip to main content

6. Normalization and Comparison

6.1. Equivalence​

The definition of URI equivalence depends on the application's requirements.

6.2. Comparison Ladder​

6.2.1. Simple String Comparison​

The fastest but least accurate comparison method.

6.2.2. Syntax-Based Normalization​

Includes:

  • Case normalization (scheme and host)
  • Percent-encoding normalization
  • Path segment normalization

Examples:

HTTP://Example.COM/path  →  http://example.com/path
http://example.com/%7Euser → http://example.com/~user
http://example.com/a/./b/../c → http://example.com/a/c

6.2.3. Scheme-Based Normalization​

Remove default ports, etc.

Examples:

http://example.com:80/  →  http://example.com/
https://example.com:443/ → https://example.com/

6.2.4. Protocol-Based Normalization​

Requires protocol-specific knowledge of accessing resources.


Next Chapter: 7. Security Considerations - URI security issues