Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use urlsplit() instead of urlparse() #184

Merged
merged 1 commit into from
Oct 15, 2022

Conversation

adamchainz
Copy link
Contributor

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: adamchainz/django-cors-headers#793

@codecov
Copy link

codecov bot commented Sep 26, 2022

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%> (ø)

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

@mattseymour mattseymour merged commit 9a4a6f3 into jazzband:master Oct 15, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants