Skip to content

4.9.1 - Remove unnecessary `mutating` behavior from `Parameters.getCatchall()`

Latest
Compare
Choose a tag to compare
@penny-for-vapor penny-for-vapor released this 05 May 21:49
8c9a227

What's Changed

Remove unnecessary mutating behavior from Parameters.getCatchall() by @gwynne in #130

Parameters.getCatchall() has historically been mutating, in order to delay the removal of percent encoding from matched catchall values until it is called for the first time. This was an unnecessary optimization which just adds confusion to the behavior of the API and makes it harder to use. We now remove the percent encoding immediately when setCatchall() is called instead.

Additional changes:

  • Minimum Swift version updated to 5.8
  • set(_:to:) now falls back to the original value if removing percent encoding fails, matching the existing behavior of the catchall logic. This should have no impact in real systems, as an invalid input of this kind should never reach the routing logic.

(N.B.: While it is an API break for a previously non-mutating method to become mutating, the reverse is not the case, so this is a patch-level change.)

This patch was released by @gwynne

Full Changelog: 4.9.0...4.9.1