Removes every trailing / from a string, typically a base URL before a path is joined onto it.
Linear in the length of the input. The regex //+$/ is not: on a string holding many slashes that
are NOT at the end, it backtracks quadratically, which makes it a denial-of-service vector on any
caller-supplied URL.
Removes every trailing
/from a string, typically a base URL before a path is joined onto it.Linear in the length of the input. The regex
//+$/is not: on a string holding many slashes that are NOT at the end, it backtracks quadratically, which makes it a denial-of-service vector on any caller-supplied URL.