jazzband / dj-database-url

Use Database URLs in your Django Application.
https://pypi.org/project/dj-database-url/
BSD 3-Clause "New" or "Revised" License
1.49k stars 205 forks source link

Use urlsplit() instead of urlparse() #184

Closed adamchainz closed 2 years ago

adamchainz commented 2 years ago

urlparse() allows for “parameters” before the ? in the URL. dj-database-url does not use these parameters.

urlsplit() supports a later (1998) RFC and does not parse such parameters. It's thus a bit faster.

Anthony Sottile did a video on the subject, which taught me about this difference, and I merged a similar change to django-cors-headers: https://github.com/adamchainz/django-cors-headers/pull/793

codecov[bot] commented 2 years ago

Codecov Report

Merging #184 (430bbfb) into master (742d74d) will not change coverage. The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master     #184   +/-   ##
=======================================
  Coverage   86.15%   86.15%           
=======================================
  Files           1        1           
  Lines          65       65           
  Branches       13       13           
=======================================
  Hits           56       56           
  Misses          4        4           
  Partials        5        5           
Impacted Files Coverage Δ
dj_database_url.py 86.15% <100.00%> (ø)

:mega: We’re building smart automated test selection to slash your CI/CD build times. Learn more