normalized-base-url.texi (1050B)
1 @c Section from ``advanced topics'' about how to normalize base URLs 2 3 @node Normalized base URLs 4 @section Normalized base URLs 5 6 Exchanges and merchants have a base URL for their service. This URL @b{must} 7 be in a canonical form when it is stored (e.g. in the wallet's database) or 8 transmitted (e.g. to a bank page). 9 10 @itemize 11 @item The URL must be absolute. This implies that the URL has a schema. 12 @item The path component of the URL must end with a slash. 13 @item The URL must not contain a fragment or query. 14 @end itemize 15 16 When a user enters a URL that is, technically, relative (such as "alice.example.com/exchange"), wallets 17 *may* transform it into a canonical base URL ("http://alice.example.com/exchange/"). Other components *should not* accept 18 URLs that are not canonical. 19 20 Rationale: Joining non-canonical URLs with relative URLs (e.g. "exchange.example.com" with "reserve/status") 21 results in different and slightly unexpected behavior in some URL handling libraries. 22 Canonical URLs give more predictable results with standard URL joining.