pydantic-core
pydantic-core copied to clipboard
Add config setting to avoid adding trailing slash to URLs
Preparation for fixing https://github.com/pydantic/pydantic/issues/7186
CodSpeed Performance Report
Merging #1719 will not alter performance
Comparing no-trailing-slash (660b112) with main (e43c144)
Summary
✅ 157 untouched benchmarks
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.
Superseded by #1789