pydantic-core icon indicating copy to clipboard operation
pydantic-core copied to clipboard

Add config setting to avoid adding trailing slash to URLs

Open samuelcolvin opened this issue 6 months ago • 1 comments

Preparation for fixing https://github.com/pydantic/pydantic/issues/7186

samuelcolvin avatar May 24 '25 17:05 samuelcolvin

CodSpeed Performance Report

Merging #1719 will not alter performance

Comparing no-trailing-slash (660b112) with main (e43c144)

Summary

✅ 157 untouched benchmarks

codspeed-hq[bot] avatar May 24 '25 17:05 codspeed-hq[bot]

Studying this, I think that it's possibly more complex than it needs to be and that the main problem case is that "empty" path gets replaced with /.

So I think we might instead just need a simpler config option like normalize_empty_path = False (or preserve_empty_path = True)? I am planning to try a reboot of this PR in that vein tomorrow.

davidhewitt avatar Sep 15 '25 20:09 davidhewitt

Superseded by #1789

davidhewitt avatar Sep 19 '25 08:09 davidhewitt